Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hi all,
I have created a measure that uses IF statements based on other columns in a table:
If(Column1 = blank(), 1,
If (Column 2 < 3, 2
etc
I've done this as a measure rather than a calculated column because I needed to include a parameter in it and calculated columns do not respond to parameters. So it actually looks more like this:
If(max(column1)=blank(),1
If(max(Column2) < [parameter], 2
etc
Now this works fine when the table is not aggregated, and the measure is looking at one row and therefore one value at a time:Pic 1
But when I want to see a count of each measure result, it of course takes the 'max' across the whole column and only gives one result:
What I'm after is something more like this:
This last pic was achieved by using a calculated column, but the results are wrong because, as I mentioned, it doesn't take into account the paramters. I'd like to show what I've done to resolve this, but tbh I'm stumped on where to start with this and haven't been able to find something similar in the forums.
Could someone point me in the right direction?
Solved! Go to Solution.
Update on this:
I found a solution in another thread. The way to do it is to create a new measure for each measure result:
Solved: Count of Measure result - Microsoft Power BI Community
Update on this:
I found a solution in another thread. The way to do it is to create a new measure for each measure result:
Solved: Count of Measure result - Microsoft Power BI Community
Hey @Anonymous ,
you can use an iterator function and do the dynamic part in the part that is executed by row.
Try the following approach:
my Measure =
SUMX(
myTable,
IF(
myTable[Column1]
= BLANK(),
1
)
)
Thanks Denis.
FYI, the results of the IF statements are actually strings i.e. "2:Many Updates" rather than numbers.
So, I've copied what you've done, using COUNTX instead.
But I'm not sure how to use this new measure to replicate something like the 3rd pic in my post as the groupings ("2:Many Updates", "4:Statistics Missing") come from the measure itself.
Atm, I've just got a count of all the rows in the table, a single number, rather than a count grouped by the different possible outcomes like in the 3rd pic
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.