The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
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.
@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 |
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
User | Count |
---|---|
64 | |
55 | |
54 | |
51 | |
31 |
User | Count |
---|---|
180 | |
88 | |
70 | |
46 | |
45 |