The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
I made a custom column similar to this;
Text or Date =
If(ISBLANK(Table1[Status], Table1[Step Status],
If(Table1[Status] = "In Progress", Table1[Step Due Date].[Date],
If(Table1[Status] = "C=Complete", Table1[Step Actual Date].[Date],
If(Table1[Status] = "Not Required", "Not Required",
Blank())))))
I receive a error:
Expressions that yield variant data-type cannot be used to define calculated columns.
I have the column set to text. I tried MIN( around the dates as well.
Any ideas of what to try next?
Thanks
Solved! Go to Solution.
First, you need to close your ISBLANK parentheses.
Addressing your actual question, you can use the FORMAT function to convert date to whatever format you'd like. For example, FORMAT ( Table1[DueDate], "mm/dd/yy" ) or FORMAT ( Table1[DueDate], "yyyy-mm-dd" ).
This is a good case to use a SWITCH function too.
Text or Date =
SWITCH (
Table1[Status],
BLANK (), Table1[Step Status],
"In Progress", FORMAT ( Table1[Step Due Date], "yyyy-mm-dd" ),
"C=Complete", FORMAT ( Table1[Step Actual Date], "yyyy-mm-dd" ),
"Not Required", "Not Required",
BLANK ()
)
Hi, @Brett007
Please try something like below.
Text or Date =
If(ISBLANK(Table1[Status], Table1[Step Status],
If(Table1[Status] = "In Progress", format(Table1[Step Due Date].[Date], "ddmmmmyyyy"),
If(Table1[Status] = "C=Complete", format(Table1[Step Actual Date].[Date], "ddmmmmyyyy"),
If(Table1[Status] = "Not Required", "Not Required",
Blank())))))
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.
Linkedin: linkedin.com/in/jihwankim1975/
Twitter: twitter.com/Jihwan_JHKIM
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
First, you need to close your ISBLANK parentheses.
Addressing your actual question, you can use the FORMAT function to convert date to whatever format you'd like. For example, FORMAT ( Table1[DueDate], "mm/dd/yy" ) or FORMAT ( Table1[DueDate], "yyyy-mm-dd" ).
This is a good case to use a SWITCH function too.
Text or Date =
SWITCH (
Table1[Status],
BLANK (), Table1[Step Status],
"In Progress", FORMAT ( Table1[Step Due Date], "yyyy-mm-dd" ),
"C=Complete", FORMAT ( Table1[Step Actual Date], "yyyy-mm-dd" ),
"Not Required", "Not Required",
BLANK ()
)
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
82 | |
65 | |
53 | |
52 |
User | Count |
---|---|
128 | |
115 | |
80 | |
65 | |
63 |