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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Anonymous
Not applicable

Display only the first date for status changes only but not as a measure

I have a measure which works perfectly as a measure.
However, I would like to filter by date using my slicer and unfortunately slicers can't use measures.
Is there any way for me to achieve the same outcome but being able to add to my slicer filter?

This is the measure that I have which works fine:

Measure x =
VAR __m = CALCULATE ( MIN ( 'Test Scripts'[Changed Date]),
ALLEXCEPT ( 'Test Scripts', 'Test Scripts'[Work Item Id], 'Test Scripts'[State] ) )
RETURN IF ( MAX ( 'Test Scripts'[Changed Date] ) == __m, __m )

-----------------------------------------------------------------------------------------------

The measure ignores when the TAG changes (or anything else changes), except for Status ("State") changes and then only gets the FIRST DATE when the Status was changed.

-------------------------------------------------------------------------------------------------------

pbi_example_table.PNG


Thank you in advance for your help

2 ACCEPTED SOLUTIONS

@Anonymoususe this:

 

 

FirstChange =
CALCULATE (
    MIN ( 'Test Scripts'[Changed Date] ),
    FILTER (
        ALL ( 'Test Scripts' ),
        [ID] = EARLIER ( [ID] )
            && [Status] = EARLIER ( 'Test Scripts'[Status] )
    )
)




Spyros Mavroforos

Data Consultant


Find me on LinkedIn or drop me an email

eSpyros

View solution in original post

v-eachen-msft
Community Support
Community Support

Hi @Anonymous ,

 

You could use "Group By" feature to get the minimum date in the query editor.

Here is the result.

3-1.PNG

Here is my test file for your reference.

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

6 REPLIES 6
v-eachen-msft
Community Support
Community Support

Hi @Anonymous ,

 

You could use "Group By" feature to get the minimum date in the query editor.

Here is the result.

3-1.PNG

Here is my test file for your reference.

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.
amitchandak
Super User
Super User

@Anonymous , with description input and the expected output, is not clear.

 

Can you share sample data and sample output in table format?

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak Sure. Find the sample tables below.

BEFORE

IDTAGTeamStatusChanged Date
007GoodTeam ANew01/06/2020
007BadTeam BNew02/06/2020
007NeutralTeam BClosed02/06/2020
007BadTeam BClosed03/06/2020


AFTER

IDTAGTeamStatusChanged Date
007GoodTeam ANew01/06/2020
007NeutralTeam BClosed02/06/2020

 

 

@Anonymoususe this:

 

 

FirstChange =
CALCULATE (
    MIN ( 'Test Scripts'[Changed Date] ),
    FILTER (
        ALL ( 'Test Scripts' ),
        [ID] = EARLIER ( [ID] )
            && [Status] = EARLIER ( 'Test Scripts'[Status] )
    )
)




Spyros Mavroforos

Data Consultant


Find me on LinkedIn or drop me an email

eSpyros

@Anonymous , Us This in place of change date in after

LASTNONBLANKVALUE(Table[Changed Date], Min(Table[Status]))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
AllisonKennedy
Super User
Super User

Measures update based on slicer selection, columns don't. Looks like you don't have any measures or slicers affecting this measure, so you could try doing this as a calculated column using EARLIER instead of variable. You'll need to probably use RANKX as well and will then need to filter out the later changes so you only have the date for the earliest change.

Is there a reason you can't use a DimDate table and relate that to Changed Date to achieve the same results?

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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