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 agoVvelarde
Community Champion
8 years ago
Try with this modification:
RANK =
VAR Share = [% share]
RETURN
IF ( Share > 0.10, "A", IF ( Share > 0.05, "B", "C" ) )Victor
- parry2k8 years ago
Super User
VvelardeThanks for getting back. Although I sorted it out but wanted to check how you experts will do. I will test your solution. Cheers!!
- Zubair_Muhammad8 years ago
Community Champion
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 ) ) )