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 am a newbie to Power BI.
I have a dataset as attached. I need to find the maximum value for each person for each week. I have written the formula in Excel
=MAX(IF(A$2:A$41 = A2, IF(C$2:C$41 =C2, B$2:B$41)))
How can I convert it to DAX or write the same formula in Power BI?
I tried the DAX Code as below, But it did not work. Any suggestions/corrections, please?
Weekly Maximum = Max(if(PT[Person]= PT[Person],IF(PT[Weeks]=PT[Weeks]),PT[value]))
And also to write a formula for taking data from two different tables.
TIA
Solved! Go to Solution.
Try this
Max Value = CALCULATE ( MAX ( PT[Value] ), ALLEXCEPT ( PT, PT[Person], PT[Weeks] ) )
Try this
Max Value = CALCULATE ( MAX ( PT[Value] ), ALLEXCEPT ( PT, PT[Person], PT[Weeks] ) )
@Zubair_Muhammad Thank you so much. Your solution worked.
Is it possible to have max(value) of the 2nd week in first, 3rd week in second and so? I need to visualize the progress in the value comparing to the previous week.
Any suggestion would be highly valuable. Thank again 🙂
Hi @Zubair_Muhammad I am trying to create the expected value from my dataset below.
I am trying to calculate the Max Value by Category using the formula below,
Weekly Maximum = CALCULATE ( MAX ( PT[total energy (J/kg)] ), ALLEXCEPT ( PT, PT[athlete], PT[WeekSequence] , PT[session category] = "MATCH") )
But was throwing me an error.
Once I calculate this, then I need to calculate the Expected value for each week, that has the maximum value of the previous week * 2.85, as shown in the screenshot.
Can I do all this in one new column, or should I add another column to add the expected weekly values?
Try this
Weekly Maximum = CALCULATE ( MAX ( PT[total energy (J/kg)] ), FILTER ( ALLEXCEPT ( PT, PT[athlete], PT[WeekSequence] ), PT[session category] = "MATCH" ) )
Thank you so much @Zubair_Muhammad. This worked perfectly. Thanks a lot.
Can you kindly suggest me some good resource for Learning DAX and Power query, please!! Much needed for my work now.
This post mentions some good learning resources
http://community.powerbi.com/t5/Desktop/Power-BI-Learning/m-p/336089/highlight/true#M150393
To get next week max in current week row.
Try this calculated column
Max Value for Next Week = CALCULATE ( MAX ( PT[Value] ), FILTER ( ALLEXCEPT ( PT, PT[Person] ), PT[Weeks] = EARLIER ( PT[Weeks] ) + 1 ) )
If you need a MEASURE then you can use this
Max Value for Next Week = CALCULATE ( MAX ( PT[Value] ), FILTER ( ALLEXCEPT ( PT, PT[Person] ), PT[Weeks] = SELECTEDVALUE ( PT[Weeks] ) + 1 ) )
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 |
---|---|
112 | |
97 | |
85 | |
67 | |
59 |
User | Count |
---|---|
150 | |
120 | |
99 | |
87 | |
68 |