The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
I am trying to write a Dax for a New Measure to display or filter the most recent entry for a Class (this is entered many times) and the Current class Number ( again entered many times and can change) but needing the most recent number.
Here is a look at My Data
as you can see I may have a class (115-23) with the Current # of agents entered several times I need to display only the most recent number of agents for each class Number.
I have this but it only gets part of the way I cant get past the if Statement if the expression is true..
Is most recent =
var CurrentClassNumber= 'Form Data'[Class Number ]
var mostRecentDate = CALCULATE(MAX('Form Data'[Entry Date]),ALL('Form Data'),'Form Data'[Class Number ] = CurrentClassNumber)
return
IF('Form Data'[Entry Date] = mostRecentDate,"","0")
Any help would be great I am a relitivly new user comeing from Excel and hitting road blocks.
Solved! Go to Solution.
Hi @HeatherBisher ,
According to your statement, I think your requirement is to show data on most recent date each class number. Here I suggest you to filter your visual by measure in visual level filter.
Is most recent =
VAR CurrentClassNumber =
MAX ( 'Form Data'[Class Number] )
VAR mostRecentDate =
CALCULATE (
MAX ( 'Form Data'[Entry Date] ),
ALL ( 'Form Data' ),
'Form Data'[Class Number] = CurrentClassNumber
)
RETURN
IF ( MAX ( 'Form Data'[Entry Date] ) = mostRecentDate, 1, 0 )
Add this measure into visual level filter and set it to show items when value = 1.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @HeatherBisher ,
According to your statement, I think your requirement is to show data on most recent date each class number. Here I suggest you to filter your visual by measure in visual level filter.
Is most recent =
VAR CurrentClassNumber =
MAX ( 'Form Data'[Class Number] )
VAR mostRecentDate =
CALCULATE (
MAX ( 'Form Data'[Entry Date] ),
ALL ( 'Form Data' ),
'Form Data'[Class Number] = CurrentClassNumber
)
RETURN
IF ( MAX ( 'Form Data'[Entry Date] ) = mostRecentDate, 1, 0 )
Add this measure into visual level filter and set it to show items when value = 1.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
78 | |
70 | |
52 | |
50 |
User | Count |
---|---|
120 | |
120 | |
76 | |
62 | |
61 |