Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowJuly 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more
I need the DAX query to get the below measure or calculated column. How to achieve ?
Get StatusName from ActionTable WHERE Action_Date = MAX(Action_Date) and Status != 17
Solved! Go to Solution.
Hi @Anonymous
Place this measure in a card visual:
GetStatusName =
VAR maxDate_ = MAX ( ActionTable[Action_Date] )
RETURN
CALCULATE (
DISTINCT ( ActionTable[StatusName] ),
ActionTable[Action_Date] = maxDate_,
ActionTable[Status] <> 17
)
|
|
Please accept the solution when done and consider giving a thumbs up if posts are helpful. Contact me privately for support with any larger-scale BI needs, tutoring, etc. |
Hi @Anonymous
Place this measure in a card visual:
GetStatusName =
VAR maxDate_ = MAX ( ActionTable[Action_Date] )
RETURN
CALCULATE (
DISTINCT ( ActionTable[StatusName] ),
ActionTable[Action_Date] = maxDate_,
ActionTable[Status] <> 17
)
|
|
Please accept the solution when done and consider giving a thumbs up if posts are helpful. Contact me privately for support with any larger-scale BI needs, tutoring, etc. |
Hey @Anonymous ,
please excuse, but I do not fully understand your requirement. As "Get StatusName ..." does not indicate if you are looking for a single value (a scalar value) or a table (a single-column table).
The solution @AlB provided might return an error, if more than one StatusName are satisfying the condition. CALCULATE(...) will return a scalar value, whereas DISTINCT() will return a table. There is an implicit datatype transformation happening as a single-column table with one row can be transformed into a scalar value if necessary, here this transformation is triggered by CALCULATE().
Maybe you can take some time and be more specific about the nature of your expected result, if the nature of your business prevents multiple StatusName for the same date and the status <> 17, then, excuse this post.
Regards,
Tom
Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.
Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.
| User | Count |
|---|---|
| 22 | |
| 22 | |
| 18 | |
| 17 | |
| 13 |
| User | Count |
|---|---|
| 61 | |
| 52 | |
| 47 | |
| 41 | |
| 38 |