Forum Discussion
Calculate Difference in Column
- 4 years ago
mwen90 This looks like a measure aggregation problem. See my blog article about that here: https://community.powerbi.com/t5/Community-Blog/Design-Pattern-Groups-and-Super-Groups/ba-p/138149
The pattern is:
MinScoreMeasure = MINX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])
MaxScoreMeasure = MAXX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])
AvgScoreMeasure = AVERAGEX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])
etc.
Thanks for the help,
Bit confused, we're not looking for an average but for the last item to be minused from the first, will average give me that?
Secondly, what is the measure your pointing to at the end of this DAX? MinScoreMeasure = MINX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])
Cheers,
- mwen904 years agoHelper III
- Greg_Deckler4 years agoCommunity Champion
mwen90 It's a pattern. You didn't provide data in text format to be able to test anything with and since you are displaying an image of visual I have no idea about what your data really looks like. So, all I can tell you is to use SUMMARIZE or GROUPBY to get your data looking like it does in your table visual. The Measure in your case would be some aggregation of Day No. Use MINX to get the minimum value and MAXX to get the maximum value.
Sorry, having trouble following, can you post sample data as text and expected output?
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882
Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.