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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Anonymous
Not applicable

Dax comparison operations do not support comparing values of type integer with the values of text.

per_fin =
SWITCH(
t_calendar[P1] = "4 Weeks",
t_calendar[P2] =VALUE( t_calendar[P1] + t_calendar[P2]) ,"8 Weeks ",
t_calendar[P3] = VALUE(t_calendar[P1] +t_calendar[P2] +t_calendar[P3]) , "12 Weeks",
t_calendar[P4] = VALUE(t_calendar[P1] +t_calendar[P2] +t_calendar[P3] +t_calendar[P4]) , "16 Weeks" ,
t_calendar[P5] = VALUE(t_calendar[P1] +t_calendar[P2]t_calendar[P3]t_calendar[P4] +t_calendar[P5] ), ">16 Weeks"
)
5 REPLIES 5
Anonymous
Not applicable

Hi @Ritaf1983 here is sample data 

Bajigntrr_0-1720422965135.png

 

Remember to adhere to the decorum of the Community Forum when asking a question.

Please provide your work-in-progress Power BI Desktop file (with sensitive information removed) that covers your issue or question completely in a usable format (not as a screenshot). You can upload the PBIX file to a cloud storage service such as OneDrive, Google Drive, Dropbox, or to a Github repository, and then share a file’s URL.

https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

This allows members of the Forum to assess the state of the model, report layer, relationships, and any DAX applied.

Ritaf1983
Super User
Super User

Hi @Anonymous 

Can you please share a pbix or some dummy data that keep the raw data structure with expected results? It should help us clarify your scenario and test to coding formula.

How to Get Your Question Answered Quickly  

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile
Anonymous
Not applicable

Hi @Ritaf1983  , i have p1,  p2, p3 , p4 and p5 columns as below

P1 = IF (t_calendar[row_num] <=4 ,"4 weeks" );
P2 = IF( t_calendar[row_num] <=8 ,  "8 weeks");
P3 = IF( t_calendar[row_num] <=12 , "12 weeks");
P4 = IF( t_calendar[row_num] <=16 , "16 weeks"); 
P5 = IF( t_calendar[row_num] > 16 , "16 weeks");
so now , i want final_per columns as below 1 column 
per_fin =
SWITCH(TRUE(),
t_calendar[P1] = "4 weeks",
t_calendar[P2] =VALUE( t_calendar[P1]t_calendar[P2]) ,"8 weeks",
t_calendar[P3] = VALUE(t_calendar[P1] + t_calendar[P2] + t_calendar[P3]) , "12 weeks",
t_calendar[P4] = VALUE(t_calendar[P1] + t_calendar[P2] +t_calendar[P3] +t_calendar[P4]) , "16 weeks" ,
t_calendar[P5] = VALUE(t_calendar[P1] +t_calendar[P2] +t_calendar[P3] +t_calendar[P4] +t_calendar[P5] ), ">16 weeks"
)
So, here i want to get the data in slicer , when P1 selects then "4 weeks" data should show , and if P2 selects in slicer then "8 weeks" data show , recepectivly 12, 16 and >16 ..but this switch condtion getting as " Dax omparison operations do not support comparing values of type integer with the values of text." 
any help is appriciated 
 

Hi @Anonymous 
Sorry, I need the data to help...

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors