Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi,
I have two date columns and I am trying to create a calculated column depending on the combination of these two colums. Is there anyway to create them as a nested statement, that returns a text value, so that it can be used as a slicer with all the variable options?
ie IF Date1 & Date 2 is value then "Complete" is returned.
IF Date1 has a value & Date2 is blank then "Date2 missing" is returned etc.
Solved! Go to Solution.
Like this?
CalcCol =
SWITCH (
TRUE (),
ISBLANK ( Table1[Date1] ) && ISBLANK ( Table1[Date2] ), "Both dates missing",
ISBLANK ( Table1[Date1] ), "Date1 missing",
ISBLANK ( Table1[Date2] ), "Date2 missing",
"Complete"
)
Thank you, I wasn't aware of SWITCH command. This has helped greatly.
Like this?
CalcCol =
SWITCH (
TRUE (),
ISBLANK ( Table1[Date1] ) && ISBLANK ( Table1[Date2] ), "Both dates missing",
ISBLANK ( Table1[Date1] ), "Date1 missing",
ISBLANK ( Table1[Date2] ), "Date2 missing",
"Complete"
)
Calculated column:
https://radacad.com/write-conditional-statement-using-switch-in-dax-and-power-bi
https://blog.enterprisedna.co/using-advanced-dax-for-multiple-if-statement-in-power-bi/
I prefer to do in Power Query, depends on your needs
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 35 | |
| 33 | |
| 32 | |
| 29 |
| User | Count |
|---|---|
| 132 | |
| 90 | |
| 78 | |
| 66 | |
| 65 |