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.
Hello everyone
I am a sort of a beginner in DAX so I can't figure out how to get the result I want. I have the model shown below
What I want to do is this:
1) Filter Snapshot Info to get the latest [Date Time]
2) Get [Value] of Time Profile where [Snapshot ID] = 'Snapshot Info'[Snapshot ID] && [Start Time Interval] = 'Snapshot Info'[Start Time] from the previous step
Nood question I know but I'm stuck
Thank you!
Solved! Go to Solution.
My bad. Misread your post. Please see if this one works. If not, please explain more on how you are using this measure.
Value Measure =
VAR __latestdate =
MAX ( 'Snapshot Info' )
RETURN
CALCULATE (
MAX ( 'Time Profile'[Value] ),
'Time Profile'[Start Time Interval] = __latestdate
)
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Please try this measure expression. The relationship is already making sure the IDs match, but adding the TREATAS() can pass the value of Start Time to the Start Time Interval column too (if they match exactly).
Value Measure =
CALCULATE (
MAX ( 'Time Profile'[Value] ),
TREATAS (
VALUES ( 'Snapshot Info'[Start Time] ),
'Time Profile'[Start Time Interval]
)
)
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Hi @mahoneypat
It almost works. One thing left to do is get the latest Snapshot ID which I get by getting the latest 'Snapshot Info'[Date Time]. The measure is taking into account all Snapshots for now.
My bad. Misread your post. Please see if this one works. If not, please explain more on how you are using this measure.
Value Measure =
VAR __latestdate =
MAX ( 'Snapshot Info' )
RETURN
CALCULATE (
MAX ( 'Time Profile'[Value] ),
'Time Profile'[Start Time Interval] = __latestdate
)
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Do you want that as a measure or as a calculated column?
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 |
---|---|
42 | |
21 | |
21 | |
14 | |
14 |
User | Count |
---|---|
42 | |
39 | |
33 | |
19 | |
18 |