Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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 ()
)
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
103 | |
77 | |
67 | |
63 |
User | Count |
---|---|
144 | |
107 | |
105 | |
82 | |
69 |