The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi, I am new to Powerbi and I am finding it difficult to fine a DAX formula that works for what I want to do.
If column Y has a date in the column ignore column X, if column Z has a date in the column ignore column Y. If there is no date in column Zand Y return column X. Thank you for your help in advance
Column X | Column Y | Column Z | ||
22/01/2021 | 25/03/2021 |
| 28/08/2021 | |
Solved! Go to Solution.
Hi @Anonymous ,
In DAX it would be something like this:
_myDate =
SWITCH(
TRUE(),
NOT ISBLANK(yourTable[Column Z]), yourTable[Column Z],
NOT ISBLANK(yourTable[Column Y]), yourTable[Column Y],
yourTable[Column X]
)
In Power Query, you could do something like this:
List.Last(ListRemoveNulls({[Column X], [Column Y], [Column Z]}))
There's more than one way to achieve this in either DAX or Power Query though.
Pete
Proud to be a Datanaut!
Hi @Anonymous ,
In DAX it would be something like this:
_myDate =
SWITCH(
TRUE(),
NOT ISBLANK(yourTable[Column Z]), yourTable[Column Z],
NOT ISBLANK(yourTable[Column Y]), yourTable[Column Y],
yourTable[Column X]
)
In Power Query, you could do something like this:
List.Last(ListRemoveNulls({[Column X], [Column Y], [Column Z]}))
There's more than one way to achieve this in either DAX or Power Query though.
Pete
Proud to be a Datanaut!
It worked! thank you so much 🙂