The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I am getting a "Expressions that yeild variant data-type cannot be used to define calculated columns" error" if I change the 0 to "". I know this is simple but need help. I have the below calculated column.
Solved! Go to Solution.
Hi, @common763
Try below measure
Days btw dates=
if(
ISBLANK(DATE1),
0,
if(
ISBLANK(DATE2),
0,
NETWORKDAYS(DATE1,DATE2)))
OR
Days btw dates =
if(
ISBLANK(DATE1),
"",
if(
ISBLANK(DATE2),
"",
convert( NETWORKDAYS(DATE1,DATE2),STRING)
)
)
My head wasnt working yesterday...all i had to do was this below...I was putting "" instead of Blank()
Days btw dates = if(ISBLANK(DATE1,0, if(ISBLANK(DATE2),0,NETWORKDAYS(DATE1,DATE2)))
to
Days btw dates = if(ISBLANK(DATE1,BLANK(), if(ISBLANK(DATE2),BLANK(),NETWORKDAYS(DATE1,DATE2)))
thanks. this works. Appreciate it.
Hi, @common763
Try below measure
Days btw dates=
if(
ISBLANK(DATE1),
0,
if(
ISBLANK(DATE2),
0,
NETWORKDAYS(DATE1,DATE2)))
OR
Days btw dates =
if(
ISBLANK(DATE1),
"",
if(
ISBLANK(DATE2),
"",
convert( NETWORKDAYS(DATE1,DATE2),STRING)
)
)
User | Count |
---|---|
27 | |
12 | |
8 | |
8 | |
5 |
User | Count |
---|---|
31 | |
15 | |
12 | |
11 | |
7 |