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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

switch case formula as column in powerbi

statuskpi.pngi have crated the compliance status as shown in above screenshot but the value of actual is greater than min and max averages .I am not sure instead of 0 it is giving as 1 .If i implement same formula in as measure it is working fine . I am not sure what is the issue at the column level . I have given don't summarize when i drag the column at matrix visual .anyone can help here?

1 ACCEPTED SOLUTION
v-xicai
Community Support
Community Support

Hi adithyanaini,

 

From your description, it looks like the calculated column and measure which use the same DAX returns different results when there is only one row displays in the table visual, right? Based on my test, if there is only one row in the table visual, the calculated column and measure which use the same DAX display the same result, as the both calculated column and measure are calculated based on the whole table rows. See:

 

1.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

2.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

If you add any other column field to the table visual then display more than one rows in the table visual, the measure will evaluate each row in table visual to calculate average values for columns [Actual Does], [Min Does]  and [Max Does], then return corresponding value o or 1 for each row based on the switch logic in the table visual. For the calculated column which uses the same DAX, when we put the calculated column in the table visual and set with “Don’t Summarize”, the column will display the same values as in Data view. See:  

 

3.jpg 

 

 

 

 

 

 

 

 

 

 

 

 

 

Attachment is my Pbix test file: https://qiuyunus-my.sharepoint.com/:u:/g/personal/pbipro_qiuyunus_onmicrosoft_com/EdwH48MP_wRMrPkqe4...

 

You can go through these two links to learn more about the difference between calculated column and measure:

 

http://www.sqlbi.com/articles/calculated-columns-and-measures-in-dax

https://projectbotticelli.com/knowledge/dax-calculated-columns-vs-measures-video-tutorial

 

If you have any other issue, please feel free to ask.

 

Best Regards,

Amy

View solution in original post

2 REPLIES 2
v-xicai
Community Support
Community Support

Hi adithyanaini,

 

From your description, it looks like the calculated column and measure which use the same DAX returns different results when there is only one row displays in the table visual, right? Based on my test, if there is only one row in the table visual, the calculated column and measure which use the same DAX display the same result, as the both calculated column and measure are calculated based on the whole table rows. See:

 

1.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

2.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

If you add any other column field to the table visual then display more than one rows in the table visual, the measure will evaluate each row in table visual to calculate average values for columns [Actual Does], [Min Does]  and [Max Does], then return corresponding value o or 1 for each row based on the switch logic in the table visual. For the calculated column which uses the same DAX, when we put the calculated column in the table visual and set with “Don’t Summarize”, the column will display the same values as in Data view. See:  

 

3.jpg 

 

 

 

 

 

 

 

 

 

 

 

 

 

Attachment is my Pbix test file: https://qiuyunus-my.sharepoint.com/:u:/g/personal/pbipro_qiuyunus_onmicrosoft_com/EdwH48MP_wRMrPkqe4...

 

You can go through these two links to learn more about the difference between calculated column and measure:

 

http://www.sqlbi.com/articles/calculated-columns-and-measures-in-dax

https://projectbotticelli.com/knowledge/dax-calculated-columns-vs-measures-video-tutorial

 

If you have any other issue, please feel free to ask.

 

Best Regards,

Amy

v-xicai
Community Support
Community Support

Hi adithyanaini,

 

From your description, it looks like the calculated column and measure which use the same DAX returns different results when there is only one row displays in the table visual, right?

 

Based on my test, if there is only one row in the table visual, the calculated column and measure which use the same DAX display the same result, as the both calculated column and measure are calculated based on the whole table rows. See:

 

1.jpg 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

2.jpg 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

If you add any other column field to the table visual then display more than one rows in the table visual, the measure will evaluate each row in table visual to calculate average values for columns [Actual Does], [Min Does]  and [Max Does], then return corresponding value o or 1 for each row based on the switch logic in the table visual. For the calculated column which uses the same DAX, when we put the calculated column in the table visual and set with “Don’t Summarize”, the column will display the same values as in Data view. See:  

 

3.jpg 

 

 

 

 

 

 

 

 

 

 

 

 

Attachment is my Pbix test file:https://qiuyunus-my.sharepoint.com/:u:/g/personal/pbipro_qiuyunus_onmicrosoft_com/EdwH48MP_wRMrPkqe4...

 

You can go through these two links to learn more about the difference between calculated column and measure:

 

http://www.sqlbi.com/articles/calculated-columns-and-measures-in-dax

https://projectbotticelli.com/knowledge/dax-calculated-columns-vs-measures-video-tutorial

 

If you have any other issue, please feel free to ask.

 

Best Regards,

Amy

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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