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.
Hello,
I've created a measure to count enrollments week over week. My data is sliced by week and by session (each session has 8-10 weeks, depending on time of year). I'm using the following formula:
Cumulative_Enrollments = CALCULATE(SUM(Enrollments[Count], FILTER( ALLEXCEPT(Enrollments, Sessions[Session]), Enrollments[Week_Num]<=Max(Enrollments[Week_Num])))
*Note - There is a relationship built between Enrollments[Session] & Sessions[Session] that allows filtering by session across several charts/tables in the dashboard. That's why the ALLEXCEPT() function above references a different table than the rest of the formula.
This formula works absolutely perfect for any session I filter to that have 8 or 9 weeks, but if I filter to a 10-week session, the calculation begins with the Week 10 enrollment count. I don't have any of the columns sorted in any way that 10 would come before 1, so I'm stumped. I know I haven't provided much data, but hoping the answer may be simple. If not, I will be happy to provide any sample data that may be needed.
Solved! Go to Solution.
A colleague & I were able to determine a solution. Thanks!
Hi @jhartranft60,
In data table 'Enrollments', is [Week_Num] formatted as numeric (e.g 1, 2, 3, 4...10) or text (e.g Week1, Week2, Week3... Week10)? If it is a Text field, you need to add an extra column to sort the [Week_Num] column numerically rather than alphabetically.
Reference: Custom Sorting in PowerBI
Best regards,
Yuliana Gu
Hello @v-yulgu-msft,
Thank you for replying. Week_Num is formatted as a whole number. The chart is using a column "Week Text" on the X-Axis and is sorted Ascending using the Week_Num column.
-Jeremy
Hi @jhartranft60,
Please provide sample data for test.
Regards,
Yuliana Gu
A colleague & I were able to determine a solution. Thanks!
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 |
---|---|
107 | |
97 | |
75 | |
63 | |
53 |
User | Count |
---|---|
139 | |
100 | |
95 | |
85 | |
63 |