Forum Discussion
PowerBI DAX
New to PowerBI, please help.
I am trying to substract the min value of the column (Start) to the max value of the column (Finish) to get hours worked. However, I need it to be individually filtered by name otherwise I get the same answer? Thank you
measure := CALCULATE(MAX('Table'[finish]),ALLEXCEPT('Table','Table'[name]))-CALCULATE(MAX('Table'[start]),ALLEXCEPT('Table','Table'[name]))Anonymous
Anonymous
CALCULATE(MIN(Start),All(Table name))- CALCULATE(MAX(end),All(Table name)) (Create a new measure) will give the result as you reqruire. Let me know whether this is helpful
Anonymouscan you try
ALLEXCEPT('Table','Table'[date], 'Table'[name]))
6 Replies
- smpa01Community Champion
measure := CALCULATE(MAX('Table'[finish]),ALLEXCEPT('Table','Table'[name]))-CALCULATE(MAX('Table'[start]),ALLEXCEPT('Table','Table'[name]))Anonymous
- AnonymousNot applicable
smpa01 that worked, thank you! However, I forgot to mention the dates column, the report comes out every day so I need to calculate min and max of the columns by date and name. Is there an easy way to add this to your formula please?
measure := CALCULATE(MAX('Table'[finish]),ALLEXCEPT('Table','Table'[name]))-CALCULATE(MAX('Table'[start]),ALLEXCEPT('Table','Table'[name]))
Thank you very much
- smpa01Community Champion
Anonymouscan you try
ALLEXCEPT('Table','Table'[date], 'Table'[name]))
- VijayPCommunity Champion
Anonymous
CALCULATE(MIN(Start),All(Table name))- CALCULATE(MAX(end),All(Table name)) (Create a new measure) will give the result as you reqruire. Let me know whether this is helpful
- AnonymousNot applicable
VijayP thank you!