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.
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.
-------------------------------------------------------------------------------------------------------
Thank you in advance for your help
Solved! Go to Solution.
@Anonymoususe this:
FirstChange =
CALCULATE (
MIN ( 'Test Scripts'[Changed Date] ),
FILTER (
ALL ( 'Test Scripts' ),
[ID] = EARLIER ( [ID] )
&& [Status] = EARLIER ( 'Test Scripts'[Status] )
)
)
Hi @Anonymous ,
You could use "Group By" feature to get the minimum date in the query editor.
Here is the result.
Here is my test file for your reference.
Hi @Anonymous ,
You could use "Group By" feature to get the minimum date in the query editor.
Here is the result.
Here is my test file for your reference.
@Anonymous , with description input and the expected output, is not clear.
Can you share sample data and sample output in table format?
@amitchandak Sure. Find the sample tables below.
BEFORE
ID | TAG | Team | Status | Changed Date |
007 | Good | Team A | New | 01/06/2020 |
007 | Bad | Team B | New | 02/06/2020 |
007 | Neutral | Team B | Closed | 02/06/2020 |
007 | Bad | Team B | Closed | 03/06/2020 |
AFTER
ID | TAG | Team | Status | Changed Date |
007 | Good | Team A | New | 01/06/2020 |
007 | Neutral | Team B | Closed | 02/06/2020 |
@Anonymoususe this:
FirstChange =
CALCULATE (
MIN ( 'Test Scripts'[Changed Date] ),
FILTER (
ALL ( 'Test Scripts' ),
[ID] = EARLIER ( [ID] )
&& [Status] = EARLIER ( 'Test Scripts'[Status] )
)
)
@Anonymous , Us This in place of change date in after
LASTNONBLANKVALUE(Table[Changed Date], Min(Table[Status]))
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
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 |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
93 | |
84 | |
66 |