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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.