Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Help on creating DAX formula

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 belowmodel.png

 

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!

1 ACCEPTED 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





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

6 REPLIES 6
mahoneypat
Microsoft Employee
Microsoft Employee

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





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Anonymous
Not applicable

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





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Anonymous
Not applicable

@mahoneypat 

Thank you that one worked!! Cheers!

lbendlin
Super User
Super User

Do you want that as a measure or as a calculated column?

Anonymous
Not applicable

Hi @lbendlin !
I want a measure

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.