Forum Discussion
parry2k
Super User
8 years agocount by measure
hi there, I have a calculated measure to calculate the share % of each category, based on category share there is ranking, if % > 20 then A if % > 10 then B else C I added the measure for ra...
parry2k
Super User
8 years agoVvelardeThanks for getting back. Although I sorted it out but wanted to check how you experts will do. I will test your solution. Cheers!!
Zubair_Muhammad
Community Champion
8 years ago
Sorry I couldn't get time to look into this after my intial post.
Victor is right ..Great observation....this modification should fix the matter for Count of Categories
"The measure "RANK" inside FILTER (or any other ITERATOR function) will modify itself according to the Table passed as argument inside the ITERATOR. Thats why it should be put in a variable first"
Attached revised file as well
To get the distinctcount of categories
DistinctCount_Categories =
VAR myrank =
SELECTEDVALUE ( RANKs[RANK] )
RETURN
CALCULATE (
DISTINCTCOUNT ( Table1[Category] ),
CALCULATETABLE (
VALUES ( Table1[Category] ),
FILTER ( Table1, [Rank] = myrank )
)
)