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.
I want to make a report that shows only the value that is evident in the last version (yellow marked).
I tried it with the follow DAX expressions:
Solved! Go to Solution.
@sibeck_77
Please try this one:
Last Version No M =
var __no = MAX(Verkaufsoffertenarchiv[No])
var __maxno =
MAXX( FILTER( ALL(Verkaufsoffertenarchiv) , Verkaufsoffertenarchiv[No] = __no ) , Verkaufsoffertenarchiv[Version_No] )
return
CALCULATE(
SUM(Verkaufsoffertenarchiv[Amount]),
Verkaufsoffertenarchiv[Version_No] = __maxno,
Verkaufsoffertenarchiv[No] = __no
)
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
@sibeck_77
Try the following measure:
Last Version No =
var __no = MAX(Verkaufsoffertenarchiv[Version_No])
var __maxno =
MAXX( ALLEXCEPT( Verkaufsoffertenarchiv , Verkaufsoffertenarchiv[No] ) , Verkaufsoffertenarchiv[Version_No] )
return
CALCULATE(
SUM(Verkaufsoffertenarchiv[Amount]),
Verkaufsoffertenarchiv[Version_No] = __maxno,
Verkaufsoffertenarchiv[No] = __no
)
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Thanks for your quick response. Unfortunately, there is an error message:
Error Message:
MdxScript(Model) (12, 9) Calculation error in Measure 'Sales Offer Archive'[Last Version No]: DAX comparison operations do not support comparisons between values of type text and integer. You can use the VALUE function or the FORMAT function to convert one of the values.
Do you know what I have to change that your DAX expression is working?
@sibeck_77
Can you try now?
Last Version No =
var __no = MAX(Verkaufsoffertenarchiv[No])
var __maxno =
MAXX( ALLEXCEPT( Verkaufsoffertenarchiv , Verkaufsoffertenarchiv[No] ) , Verkaufsoffertenarchiv[Version_No] )
return
CALCULATE(
SUM(Verkaufsoffertenarchiv[Amount]),
Verkaufsoffertenarchiv[Version_No] = __maxno,
Verkaufsoffertenarchiv[No] = __no
)
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
@sibeck_77
I created the same scenario and tested.
Last Version No M =
var __no = MAX(Verkaufsoffertenarchiv[No])
var __maxno =
MAXX( ALLEXCEPT( Verkaufsoffertenarchiv , Verkaufsoffertenarchiv[No] ) , Verkaufsoffertenarchiv[Version_No] )
return
CALCULATE(
SUM(Verkaufsoffertenarchiv[Amount]),
Verkaufsoffertenarchiv[Version_No] = __maxno,
Verkaufsoffertenarchiv[No] = __no
)
My Table:
Result:
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
In my tests the result is that it takes the largest version no. and shows the amount just of this No. But it should be that it shows the amount of the largest version no. of every No.
Do you know what I mean?
In your test result it seems to be working... so I do not know what is wrong in my table.
@sibeck_77
Please try this one:
Last Version No M =
var __no = MAX(Verkaufsoffertenarchiv[No])
var __maxno =
MAXX( FILTER( ALL(Verkaufsoffertenarchiv) , Verkaufsoffertenarchiv[No] = __no ) , Verkaufsoffertenarchiv[Version_No] )
return
CALCULATE(
SUM(Verkaufsoffertenarchiv[Amount]),
Verkaufsoffertenarchiv[Version_No] = __maxno,
Verkaufsoffertenarchiv[No] = __no
)
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Dear @Fowmy
I have a follow-up question.
When I create a table with your DAX, the total appears with 0. Do you know how this value also still shows the totals?
Please excuse the long response time due to vacation absence.
Thanks for the adjustment, so it worked now.
Thanks again - awsome support!
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 |
---|---|
111 | |
94 | |
80 | |
68 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |