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 August 31st. Request your voucher.
Hello,
I have a measure to calculate a subtraction and the total is not correct. I followed @Greg_Deckler 's Mesaure Totals - The Final Word post.
This is my single measure code:
Uptime =
CALCULATE(
SUMX(
cr4be_productiondailylog,
DIVIDE(
cr4be_productiondailylog[cr4be_availabletime],
COUNTA( cr4be_productiondailylog[cr4be_hour] )
) - [Downtime Total] )
)
This is my Total Measure code:
Uptime Total =
VAR _table = SUMMARIZE(cr4be_productiondailylog, [cr4be_partnumber],"_value",[Uptime])
RETURN
IF(HASONEVALUE(cr4be_productiondailylog[cr4be_partnumber]), [Uptime], SUMX(_table, [_value]))
These are my pbix and data files:
This is what I'm getting:
I appreciate any help.
I'm wondering if I have to change the initial single measure for a simpler one to make it work.
Thanks,
Fernando
Solved! Go to Solution.
Hi @calerof,
You have two main issues on the formula for the total time:
Redo your total to the following measure:
VAR _table =
SUMMARIZE (
cr4be_productiondailylog,
cr4be_productiondailylog[cr4be_workcenter],
cr4be_productiondailylog[cr4be_mold],
[cr4be_partnumber],
cr4be_productiondailylog[cr4be_shiftname],
"_value", [Uptime]
)
RETURN
IF (
ISINSCOPE ( cr4be_productiondailylog[cr4be_partnumber] ),
[Uptime],
SUMX ( _table, [_value] )
)
Check result below and in attach PBIX file.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @calerof,
You have two main issues on the formula for the total time:
Redo your total to the following measure:
VAR _table =
SUMMARIZE (
cr4be_productiondailylog,
cr4be_productiondailylog[cr4be_workcenter],
cr4be_productiondailylog[cr4be_mold],
[cr4be_partnumber],
cr4be_productiondailylog[cr4be_shiftname],
"_value", [Uptime]
)
RETURN
IF (
ISINSCOPE ( cr4be_productiondailylog[cr4be_partnumber] ),
[Uptime],
SUMX ( _table, [_value] )
)
Check result below and in attach PBIX file.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @MFelix ,
Thank you very much for your analysis, the explanation and help, I appreciate it a lot. That made me understand better the function SUMMARIZE.
Best,
Fernando
User | Count |
---|---|
77 | |
77 | |
36 | |
30 | |
28 |
User | Count |
---|---|
107 | |
100 | |
55 | |
49 | |
45 |