The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
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.
Hi @Anonymous
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.
Hi @Anonymous
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.
@Anonymous , 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
User | Count |
---|---|
65 | |
61 | |
60 | |
53 | |
30 |
User | Count |
---|---|
180 | |
88 | |
71 | |
48 | |
46 |