Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hi all,
I am struggling to show the names and amount, for only those records that has recent dates. I do have duplicate IDs with same name, as well as different names. the output section in the screenshot is how I want to see my data. I would appreciate your help.
I tried this but its not working:
Solved! Go to Solution.
@newtopbidax
You are right. This is becuase the thr ID is not actually "in scope".
Please refer to attached sample file with the solution
Measure =
SUMX (
VALUES ( 'Table'[Name] ),
CALCULATE (
VAR CurrentAmount =
MAX ( 'Table'[Amount] )
VAR Result =
MAXX (
TOPN (
1,
FILTER ( ALL ( 'Table' ), 'Table'[ID] = MAX ( 'Table'[ID] ) ),
'Table'[Date]
),
'Table'[Amount]
)
RETURN
IF ( CurrentAmount = Result, Result )
)
)
Hi @newtopbidax
Please try
=
MAXX (
TOPN (
1,
CALCULATETABLE ( 'Table', ALLEXCEPT ( 'Table', 'Table'[ID] ) ),
'Table'[Date]
),
'Table'[Amount]
)
Hi @tamerj1, thank you for a quick reply.
I tried your solution but I am still not getting the right output. I get the same amount for all names. If I filter for ID = 1, I'm getting this:
How do I ignore the ones with older dates?
=
VAR CurrentAmount =
MAX ( 'Table'[Value] )
VAR Result =
MAXX (
TOPN (
1,
CALCULATETABLE ( 'Table', ALLEXCEPT ( 'Table', 'Table'[ID] ) ),
'Table'[Date]
),
'Table'[Amount]
)
RETURN
IF ( CurrentAmount = Result, Result )
@tamerj1
That's still not working, its taking me to the else condition and giving blank values for everything.
@newtopbidax
You are right. This is becuase the thr ID is not actually "in scope".
Please refer to attached sample file with the solution
Measure =
SUMX (
VALUES ( 'Table'[Name] ),
CALCULATE (
VAR CurrentAmount =
MAX ( 'Table'[Amount] )
VAR Result =
MAXX (
TOPN (
1,
FILTER ( ALL ( 'Table' ), 'Table'[ID] = MAX ( 'Table'[ID] ) ),
'Table'[Date]
),
'Table'[Amount]
)
RETURN
IF ( CurrentAmount = Result, Result )
)
)
Ask questions in Eventhouse and KQL, Eventstream, and Reflex.
Check out the May 2024 Power BI update to learn about new features.
User | Count |
---|---|
71 | |
43 | |
21 | |
21 | |
14 |
User | Count |
---|---|
124 | |
42 | |
39 | |
28 | |
24 |