Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
rezaaditia
Helper III
Helper III

expression that yield variant data-type cannot be used to define calculated columns

Hi -

 

Please help, i am stuck with this formula, had searched over the internet, but no luck

i want to create TAT column using Dax formula with adding new column,

 

TAT = 
IF (
    ISBLANK ([po_creation_date].[Date] ) || ISBLANK ( [po_release_supplier2].[Date])~
    0~
    IF (
        [po_creation_date].[Date] <= [po_release_supplier2].[Date]~
        CALCULATE (
            SUM ( 'Calendar'[IsWorkingDay2] )~
            DATESBETWEEN ( 'Calendar'[Date]~'p2p-report'[po_creation_date]~'p2p-report'[po_release_supplier2] )
        )-1~
        - CALCULATE (
            SUM ( 'Calendar'[IsWorkingDay2] )~
            DATESBETWEEN ( 'Calendar'[Date]~'p2p-report'[po_release_supplier2]~'p2p-report'[po_creation_date] )
        )-1
    )
)

instead 0 i want to put "in progress", but i got that error...

IF (
    ISBLANK ([po_creation_date].[Date] ) || ISBLANK ( [po_release_supplier2].[Date])~
    "In Progress"~

any suggestion?

 

Thanks

Regards,

Reza

 

1 ACCEPTED SOLUTION
v-chuncz-msft
Community Support
Community Support

@rezaaditia 

 

Append the following text to the end of your formula.

& ""
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

8 REPLIES 8
v-chuncz-msft
Community Support
Community Support

@rezaaditia 

 

Append the following text to the end of your formula.

& ""
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks @v-chuncz-msft  your suggestion is working.

 

Thanks @amitchandak for your assistance, got the answer from your last feedback,

 

Really appreciate with your help

Hi @v-chuncz-msft 

 

Thanks for your reply.

I don't know if i use correctly or not, but i tried below still shows #error

 

IF (
    ISBLANK ( [srm_sc_appr_dt].[Date] ) || ISBLANK ( [po_creation_date] )~
    0 & "in progress"~

Thanks

else condition is not very clear. Can you try something like

 

TAT = 
IF (
    ISBLANK (([po_creation_date].[Date] ) || ISBLANK ( [po_release_supplier2].[Date])),
    "InProgress",
    IF (
        [po_creation_date].[Date] <= [po_release_supplier2].[Date],
        concatenate(CALCULATE (
            SUM ( 'Calendar'[IsWorkingDay2] )~
            DATESBETWEEN ( 'Calendar'[Date]~'p2p-report'[po_creation_date]~'p2p-report'[po_release_supplier2] )
        )-1
        - CALCULATE (
            SUM ( 'Calendar'[IsWorkingDay2] )~
            DATESBETWEEN ( 'Calendar'[Date]~'p2p-report'[po_release_supplier2]~'p2p-report'[po_creation_date] )
        )-1,"")
    )
)


TAT = 
IF (
    ISBLANK (([po_creation_date].[Date] ) || ISBLANK ( [po_release_supplier2].[Date])),
    "InProgress",
    IF (
        [po_creation_date].[Date] <= [po_release_supplier2].[Date],
        concatenate(CALCULATE (
            SUM ( 'Calendar'[IsWorkingDay2] )~
            DATESBETWEEN ( 'Calendar'[Date]~'p2p-report'[po_creation_date]~'p2p-report'[po_release_supplier2] )
        )-1,""),
        concatenate( CALCULATE (
            SUM ( 'Calendar'[IsWorkingDay2] )~
            DATESBETWEEN ( 'Calendar'[Date]~'p2p-report'[po_release_supplier2]~'p2p-report'[po_creation_date] )
        )-1,"")
    )
)
Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
amitchandak
Super User
Super User

Concat empty string to non zero result too. Then you will able to given in progress instead of zeo. But that might impact sorting.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Here we are comparing text format year with numeric format year

CALCULATE(sum(Sales[Sales]),OrderTime[Order Year]= CONCATENATE( Year(NOW())-2,""))
Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi @amitchandak 

 

I did try but still got same error.

 

Thanks

Share new calculation

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.