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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
varelapablo90
Helper II
Helper II

IF between DATEs return a TEXT values, how?

Hello community

 

I am having the below issue:

DAX comparison operations do not support comparing values of type Date with values of type Text. Consider using the VALUE or FORMAT function to convert one of the values.

 

I want to create a new column that checks if something (Clearing Date) happened between a period of 2 dates (Start reporting & End Reporting), in case of True return a text column with the responsible HUB and if false just type "Non Scope"

 

HUB_Scope =
IF (
    T_[Clearing Date]
        >= RELATED ( T_Mapping[Start Reporting] ) & T_[Clearing Date]
        <= RELATED ( T__Mapping[End Reporting] ),
    RELATED ( T_Mapping[HUB_SCOPE] ),
    "NON SCOPE"
)

 

Clearing Date. Start Reporting and End Reporting are Dates but HUB_Scope isnt.

 

How can I can I make work the above formula ??

 

Thanks

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

You're using & which is the concatenation operator, you need to use && which is logical AND.

HUB_Scope =
IF (
    T_[Clearing Date] >= RELATED ( T_Mapping[Start Reporting] )
        && T_[Clearing Date] <= RELATED ( T__Mapping[End Reporting] ),
    RELATED ( T_Mapping[HUB_SCOPE] ),
    "NON SCOPE"
)

View solution in original post

2 REPLIES 2
johnt75
Super User
Super User

You're using & which is the concatenation operator, you need to use && which is logical AND.

HUB_Scope =
IF (
    T_[Clearing Date] >= RELATED ( T_Mapping[Start Reporting] )
        && T_[Clearing Date] <= RELATED ( T__Mapping[End Reporting] ),
    RELATED ( T_Mapping[HUB_SCOPE] ),
    "NON SCOPE"
)

Oh my... thank you very much 😊

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.