Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hey I have this table "Activities" with a column [ActivityType]. There are several different activities like "email" and "meeting". I want to have a count of what activity type is max and min and return what activity it is... not just the count.
Right now I am doing these measures:
Countactivity= COUNTROWS
MaxActivity= MAXX(VALUES(Activities[ActivityType]),[countactivity])
MinActivity = MINX (VALUES(Activities[ActivityType]), [countactivity])
I am getting 66K for the max and 108 for the min. How do I display what activity is associated to the max and min?
Solved! Go to Solution.
Thanks for reaching out to us.
you can try this,
Count = CALCULATE(COUNTROWS(Activities),ALLEXCEPT(Activities,Activities[ActivityType]))
MaxActivity =
var _max=MAXX(Activities,[Count])
return MAXX(FILTER(Activities,[Count]=_max),[ActivityType])
MinActivity =
var _min=MINX(Activities,[Count])
return MAXX(FILTER(Activities,[Count]=_min),[ActivityType])
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
Thanks for reaching out to us.
you can try this,
Count = CALCULATE(COUNTROWS(Activities),ALLEXCEPT(Activities,Activities[ActivityType]))
MaxActivity =
var _max=MAXX(Activities,[Count])
return MAXX(FILTER(Activities,[Count]=_max),[ActivityType])
MinActivity =
var _min=MINX(Activities,[Count])
return MAXX(FILTER(Activities,[Count]=_min),[ActivityType])
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
@avawhittington , I have this code for date, but it should help in your case too
https://amitchandak.medium.com/power-bi-get-the-last-latest-value-of-a-category-d0cf2fcf92d0
Use min in place of max for Minimum value
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
97 | |
86 | |
70 | |
62 |
User | Count |
---|---|
151 | |
120 | |
103 | |
87 | |
68 |