Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Good morning
I have a lot of data like this:
Date | lot number | manufactured (kg) |
01/01/2020 | 1 | 200 |
01/01/2020 | 2 | 400 |
01/01/2020 | 3 | 300 |
01/01/2020 | 4 | 100 |
02/01/2020 | 5 | 100 |
02/01/2020 | 6 | 200 |
02/01/2020 | 7 | 100 |
03/01/2020 | 8 | 300 |
03/01/2020 | 9 | 300 |
03/01/2020 | 10 | 300 |
03/01/2020 | 11 | 500 |
03/01/2020 | 12 | 300 |
and so to this day. I want to get on a card the maximum or minimum value that has been manufactured in a day. In this case, you should say the MAX card: 1700kg, and MIN: 400kg
I can't find it. Thank you
Solved! Go to Solution.
you can also try to create two measures as below.
MAX = MAXX('Table',CALCULATE(sum('Table'[manufactured (kg)]),ALLEXCEPT('Table','Table'[Date])))
MIN = MINX('Table',CALCULATE(sum('Table'[manufactured (kg)]),ALLEXCEPT('Table','Table'[Date])))
Proud to be a Super User!
you can also try to create two measures as below.
MAX = MAXX('Table',CALCULATE(sum('Table'[manufactured (kg)]),ALLEXCEPT('Table','Table'[Date])))
MIN = MINX('Table',CALCULATE(sum('Table'[manufactured (kg)]),ALLEXCEPT('Table','Table'[Date])))
Proud to be a Super User!
Hi,
And if I want it the same but instead the day, indicate the month?
Thank you again
if you want to show the max month or min month, you can try to create a month column and use the similar DAX.
month = year('Table'[Date])&month('Table'[Date])
MAX = MAXX('Table',CALCULATE(sum('Table'[manufactured (kg)]),ALLEXCEPT('Table','Table'[month])))
Proud to be a Super User!
Perfect. Thank you!
@alucas85 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.
In your case:
Measure =
MINX(
SUMMARIZE(
'Table',
[Date],
"Sum",SUM([manufactured (kg)]
),
[Sum]
)
User | Count |
---|---|
98 | |
89 | |
82 | |
70 | |
67 |
User | Count |
---|---|
115 | |
104 | |
101 | |
72 | |
64 |