Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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 ()
)
User | Count |
---|---|
93 | |
83 | |
77 | |
71 | |
65 |
User | Count |
---|---|
114 | |
101 | |
96 | |
65 | |
60 |