Forum Discussion
Dax comparison operations do not support comparing values of type integer with the values of text.
5 Replies
- Ritaf1983
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.
- AnonymousNot 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 columnper_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- Ritaf1983
Super User
Hi Anonymous
Sorry, I need the data to help...
- AnonymousNot applicable
- foodd
Community Champion
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-Forum/ba-p/963216
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/1447523/highlight/true#M607150
This allows members of the Forum to assess the state of the model, report layer, relationships, and any DAX applied.