I am currently working on a measure using the following table:
I am using the following measure:
Last CC = VAR MaxStatus = MAX('Work Order Time Transactions'[Status]) Return MAXX( FILTER( 'Work Order Time Transactions', MaxStatus && 'Work Order Time Transactions'[Reason Code] = "0B" ), 'Work Order Time Transactions'[Center] )
The measure works but does not give me the desired result. For the table above I want to know the last Center for maximum Status and reason Code 0B. In the table, the results for abc should be G1H40 since the maximum Status with reason Code 0B is 90, but the measure computes G1X50 since the string is the biggest. I found the gap in my measure but I am struggling to solve it.
I gladly appreciate any hints to solve this issue.
Thanks & Best regards
Solved! Go to Solution.
VAR maxStatus =
MAX ( 'Work Order Time Transactions'[Status] ),
'Work Order Time Transactions',
'Work Order Time Transactions'[Item]
'Work Order Time Transactions'[Reason Code] = "0B"
SELECTEDVALUE ( 'Work Order Time Transactions'[Center] ),
'Work Order Time Transactions'[Status] = maxStatus
thanks for your approach. I had to modify it though, with the Allexcept it did not work. However once I removed that filter it showed the same results.
@hanssonnor Hi Hanssonnor, I have noticed that extracting highest or lowest recode within categories is quite tipical problem which lots of people are facing. And Allexcept function is quite useful for those problems.
@hanssonnor , Try a measure like
calculate(lastnonblankvalue('Work Order Time Transactions'[Status], max('Work Order Time Transactions'[Center])),'Work Order Time Transactions'[Reason Code] = "0B")
Join us for an in-depth look at the new Power BI features and capabilities at the free Microsoft Business Applications Launch Event.
Join our monthly meetings and learning sessions.
We are excited to announce the Power BI Super Users!
100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.