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

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

Reply
Saxon10
Post Prodigy
Post Prodigy

“DAX comparison operations do not support comparing values of type Integer with values of type Text.

 

I have two tables one is data and another one is report.

 

Data Table:

 

In data table the following columns are Item, A1, B1 and C1, item column stored as a text and remaining columns are (A1, A2,A3) are stored as a number.

 

ITEM      A1          A2          A3

123        10           20           30

124        40           50           60

125        70           80           90

126        100        110        120

127        130        140        150

128        160        170        180

129        190        200        210

130        220        230        240

131        250        260        270

 

Report Table:

 

In Report table contain item column and it’s stored as a text.

 

ITEM

A1

B1

C1

STATUS

123

10

20

30

#ERROR

124

40

50

60

#ERROR

12

   

#ERROR

1323

   

#ERROR

12

   

#ERROR

1567

   

#ERROR

125

70

80

90

#ERROR

4677

   

#ERROR

6232

   

#ERROR

 

 

Relationship:

 

In between two tables the item column are common.

 

Result

 

I already pull the data (A1, A2 and A3) into report table according to the item.

I would like to build the status based on the 3 columns – A1, A2 and A3 but I am receiving the following error when I try to attempt switch function “DAX comparison operations do not support comparing values of type Integer with values of type Text. Consider using the VALUE or FORMAT function to convert one of the values”.

 

Can you please advise were I need to modify the DAX formula? In lookup value function or switch function/?

 

 

A1 = LOOKUPVALUE(DATA[A1],DATA[ITEM],REPORT[ITEM])

 

B1 = LOOKUPVALUE(DATA[A2],DATA[ITEM],REPORT[ITEM])

 

C1 = LOOKUPVALUE(DATA[A3],DATA[ITEM],REPORT[ITEM])

 

STATUS = SWITCH(TRUE(),REPORT[A1]=0,"Not Okay", REPORT[A1]="","Not okay",REPORT[B1]=0,"Not Okay",REPORT[B1]="","Not Okay",REPORT[C1]=0,"Not Okay",REPORT[C1]="","Not Okay",REPORT[A1]>0,"Okay",REPORT[B1]>0,"Okay",REPORT[C1]>0,"okay")

 

Here is the PBI file for your reference https://www.dropbox.com/s/0n92kv5pol7zvb5/DAX%20comparison%20operations%20do%20not%20support%20compa...

 

 

 

 

 

 

1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

@Saxon10 

It was the line REPORT[A1]="".  "" is a string, you have to use BLANK()

STATUS =
SWITCH (
    TRUE (),
    REPORT[A1] = 0, "Not Okay",
    REPORT[A1] = BLANK (), "Not okay",
    REPORT[B1] = 0, "Not Okay",
    REPORT[B1] = BLANK (), "Not Okay",
    REPORT[C1] = 0, "Not Okay",
    REPORT[C1] = BLANK (), "Not Okay",
    REPORT[A1] > 0, "Okay",
    REPORT[B1] > 0, "Okay",
    REPORT[C1] > 0, "okay"
)

jdbuchanan71_0-1621171905621.png

 

View solution in original post

2 REPLIES 2
jdbuchanan71
Super User
Super User

@Saxon10 

It was the line REPORT[A1]="".  "" is a string, you have to use BLANK()

STATUS =
SWITCH (
    TRUE (),
    REPORT[A1] = 0, "Not Okay",
    REPORT[A1] = BLANK (), "Not okay",
    REPORT[B1] = 0, "Not Okay",
    REPORT[B1] = BLANK (), "Not Okay",
    REPORT[C1] = 0, "Not Okay",
    REPORT[C1] = BLANK (), "Not Okay",
    REPORT[A1] > 0, "Okay",
    REPORT[B1] > 0, "Okay",
    REPORT[C1] > 0, "okay"
)

jdbuchanan71_0-1621171905621.png

 

Thanks for your reply and your solution working well.

 

Thank you. 

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!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Solution Authors
Top Kudoed Authors