mardi 7 avril 2020

Power BI: If statement for shape mapping

I need to create an if statement that either provides the count for a county or if the variable is national gives the total count for national items. The dax below isn't working as it's coming out with different values against the National locations rather than the total "national" against all the counties.

Column = if(Locations[County/National]= "National", calculate(counta(Mockdata[Unique ID]), filter(Mockdata, Mockdata[County]="National")), calculate(counta(Mockdata[Unique ID]), filter(Mockdata, Mockdata[County]=Locations[County])))

My table has a list of counties and duplicates, with an addition column (County/National) indicating whether it's county or national.

Ultimately I would like to display this on a map, with the ability to toggle between county and national.

Aucun commentaire:

Enregistrer un commentaire