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 have a measure that is meant to sum the previous seven days of a filtered table. The measure works well when a single location is selected in a slicer but I am having trouble getting the measure to create a total for the columns when there is more than one location selected. I believe I need to use the sumx function to total the column, but the results I am getting are not correct.
I have prepared a sample file which can be downloaded at this link: https://www.dropbox.com/s/tq405siw51tmt20/Sample%20Multi%20Location.pbix?dl=0
The file has two pages, one for the single location measure, which is working correctly and a second that shows the multi-location measure, which is not working correctly.
Thank you for your help
Thank you for your help.
Solved! Go to Solution.
hi, @Anonymous
You could try this formula as below:
PaidSevenDaySum Multi Location = var a=MAXX('Labor','Labor'[CalendarDate]) return Calculate(sum(Labor[DailyLabor]),filter(ALLEXCEPT(Labor,LocationInformation[LocationID]),Labor[Labor_report_description]="Total Paid (D + I)" &&'Labor'[CalendarDate]>a-7 &&'Labor'[CalendarDate]<=a) )
Result:
Best Regards,
Lin
hi, @Anonymous
You could try this formula as below:
PaidSevenDaySum Multi Location = var a=MAXX('Labor','Labor'[CalendarDate]) return Calculate(sum(Labor[DailyLabor]),filter(ALLEXCEPT(Labor,LocationInformation[LocationID]),Labor[Labor_report_description]="Total Paid (D + I)" &&'Labor'[CalendarDate]>a-7 &&'Labor'[CalendarDate]<=a) )
Result:
Best Regards,
Lin
Yes, exactly what I needed.
Thank you!
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 | |
99 | |
78 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
94 | |
84 | |
67 |