Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I'm having a very weird issue with SUMX and date filters.
The current formula I am using is as follows:
RunTimeTest2 = SUMX('Date', MAX(DataPartCell1[ShiftHour]) - MIN(DataPartCell1[ShiftHour]))
The values shown (22.92 and 13.17) are correct, the total is not. I have 2 days selected so the total is 2022-01-27*2 = 22.92*2 = 45.83
How can I fix this? I'm kind of stumped here.
Solved! Go to Solution.
I was able to solve this following this guide:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907
Using two measures, the first one being:
RunTimeTest2 = SUMX('Date', MAX(DataPartCell1[ShiftHour]) - MIN(DataPartCell1[ShiftHour]))
The second one being:
ActualRuntime =
VAR __table = SUMMARIZE('Date',[Date],"__value",[RunTimeTest2])
RETURN
IF(HASONEVALUE('Date'[Date]),[RunTimeTest2],SUMX(__table,[__value]))
Hi,
This is a common issue and it has to do with the way totals work on visualizations. I recommend cheking this post by SQLBI to understand what is going on: https://www.sqlbi.com/articles/summing-values-for-the-total/
Proud to be a Super User!
I was able to solve this following this guide:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907
Using two measures, the first one being:
RunTimeTest2 = SUMX('Date', MAX(DataPartCell1[ShiftHour]) - MIN(DataPartCell1[ShiftHour]))
The second one being:
ActualRuntime =
VAR __table = SUMMARIZE('Date',[Date],"__value",[RunTimeTest2])
RETURN
IF(HASONEVALUE('Date'[Date]),[RunTimeTest2],SUMX(__table,[__value]))
User | Count |
---|---|
25 | |
12 | |
8 | |
6 | |
6 |
User | Count |
---|---|
26 | |
12 | |
11 | |
10 | |
6 |