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

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.

Reply
Anonymous
Not applicable

Need help with one of my first DAX queries. I think it is easy.

I am trying to write a DAX query to get the value for a member, from a Dimension.  The Dimension is called AllYears and has two members.  I want to get the first or last memeber.  In my senerio the Column name is CurrentDay.  This value has the date or data was last run.  So I will use on reports to show how current the data is.  I inherited the model, so can't really change it.

 

This returns both values...  Evaluate(values( 'AllYears'[CurrentDay])).   But I only want "09/05/2019"

 

Any help appreciated,

Capture.PNG

Mike

1 REPLY 1
Anonymous
Not applicable

This works...    

EVALUATE
(LASTNONBLANK('AllYears'[CurrentDay],[CurrentDay] )
)

 

But Id almost rather filter out the non date values...   so was trying this, but its not working.

 

EVALUATE
(
CALCULATE (
    FIRSTNONBLANK ( 'AllYears'[CurrentDay],[CurrentDay]  ),
    FILTER ( ALL ( 'AllYears' ), 'AllYears'[CurrentDay] <> BLANK () )
 )
)

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors