Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I have a table as below, which defines the No. of a persons and his corresponding workload for each week, I want to get a card telling me the maximum value of man_week summarize by week_ending regardless the "No.". I have tried different ways but still can't get it.
can you help me?
thanks in advance.
No. | Week_ending | Man_week |
1 | 6/4/2021 | 1 |
1 | 6/11/2021 | 1 |
1 | 6/18/2021 | 1 |
1 | 6/25/2021 | 1 |
1 | 7/2/2021 | 1 |
1 | 7/9/2021 | 1 |
1 | 7/16/2021 | 1 |
1 | 7/23/2021 | 1 |
1 | 7/30/2021 | 1 |
2 | 7/2/2021 | 1 |
2 | 7/9/2021 | 1 |
2 | 7/16/2021 | 1 |
2 | 7/23/2021 | 1 |
2 | 7/30/2021 | 1 |
6 | 6/4/2021 | 0.5 |
6 | 6/11/2021 | 0.5 |
6 | 6/18/2021 | 0.5 |
6 | 6/25/2021 | 0.5 |
6 | 7/2/2021 | 0.5 |
6 | 7/9/2021 | 0.5 |
6 | 7/16/2021 | 0.5 |
6 | 7/23/2021 | 0.5 |
6 | 7/30/2021 | 0.5 |
Hi @Wayne_Wu888
I don't quite get this... Can you please use a really simple but representative table with raw data (something like above) and show us the calculation "in slow motion," so to speak, and the final result you're expecting? This will then hopefully make it clear how to write the DAX. Thanks.
In case of doubts... please read THIS.
Hi @Anonymous ,
Here I have a line chart showing the curve of man_week for each week, the maximum value is 61, now I want to make a card telling me the number of "61" directly.
can you help?
One of the following will do what you want:
[Total Manhours] = sum( T[Man_week] )
// This one gives you the max manhours
// w.r.t. the selected people and
// selected weeks.
[Max Manhours] =
CALCULATE(
MAXX(
SUMMARIZE(
T,
T[No.],
T[Week_ending]
),
[Total Manhours]
),
ALLSELECTED( T )
)
// or
// This one gives you the max manhours
// w.r.t. the total for all selected
// people across the selected weeks.
[Max Manhours] =
CALCULATE(
MAXX(
DISTINCT( T[Week_ending] ),
[Total Manhours]
),
ALLSELECTED( T )
)
@Wayne_Wu888 , for you reference,
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Hi @CNENFRNL,
Thanks for help, unfortunately that's not what i'm looking for.
actually i want to get the maxium value of summarize of Man_week by week_ending regardless the No., I have done this but it doesn't work properply.
Peak Work_load =
VAR work_load =
SUMMARIZE(
'table',
'table'[Man_week],
"SUM work_load",SUM('table'[Man_week])
)
VAR Peak_work_load = MAXX(Work_load,[SUM Work_load])
RETURN
MAXX(FILTER(work_load,[SUM work_load] = Peak_work_load),'table'[Man_week])
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
55 | |
25 | |
23 | |
14 | |
11 |
User | Count |
---|---|
78 | |
63 | |
47 | |
17 | |
12 |