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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
kennylch
Helper I
Helper I

Column give incorrect result

The last column "Healthy Level" gives incorrect result. As you can see the formula is like this. The text column created based on the value in a measure. 

 

The formula for the column is like this . But as you can see. it gives invalid result on this 

 

Healthy Level = SWITCH(
    True(),
    KFACTOR[Net Qty]>5, "Above Healthy",
    KFACTOR[Net Qty]>0, "Healthy Level",
    "Unhealthy Level"
)
 
You may download the bi file here for testing 
 
 
Untitled.png
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @kennylch ,

 

Thanks Idrissshatila , Ronald123  and SamInogic  for the quick reply. I have some other thoughts to add:
Since your parameter in SWITCH is a measure, and you create a calculated column, the result is unexpected. Measures are dynamic, and they're contextually influenced, so the results of the measure you see in the visual may not match the results of the measure that it's in a calculated column. So we need to create a measure:

 

Measure Healthy Level = SWITCH(
    True(),
    [Healthy]>5, "Above Healthy",
    [Healthy]>0, "Healthy Level",
    "Unhealthy Level"
)

Then set the filter in the filter pane.

vtangjiemsft_0-1724814253432.png

 

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

View solution in original post

11 REPLIES 11
Anonymous
Not applicable

Hi @kennylch ,

 

Thanks Idrissshatila , Ronald123  and SamInogic  for the quick reply. I have some other thoughts to add:
Since your parameter in SWITCH is a measure, and you create a calculated column, the result is unexpected. Measures are dynamic, and they're contextually influenced, so the results of the measure you see in the visual may not match the results of the measure that it's in a calculated column. So we need to create a measure:

 

Measure Healthy Level = SWITCH(
    True(),
    [Healthy]>5, "Above Healthy",
    [Healthy]>0, "Healthy Level",
    "Unhealthy Level"
)

Then set the filter in the filter pane.

vtangjiemsft_0-1724814253432.png

 

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

That's right. I actually create another measure column and the result turns out correct. But the moment i insert this newly created measure column into matrix. THe matrix has repeating row issue. 

 

Please see the file 

 

Test Data modified.pbix 

 

 

Anonymous
Not applicable

Hi @kennylch ,

 

This is due to the fact that your visual objects come from fields in different tables, and because the metrics are affected by context there is a Cartesian product and therefore duplication. You can set [Req Qty (Kfactor x Plan Launch)] is not blank in the filter pane to achieve the correct result.

vtangjiemsft_0-1724915193580.png

 

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

SamInogic
Super User
Super User

Hi,

 

As per our understanding, you want to include the rows where Net Qty is equal to 5 in the "Above Healthy" category. To do this, we can update the DAX formula for the "Healthy Level" column like this:

 

Healthy Level =

SWITCH(

    TRUE(),

    'Table'[Net Qty] >= 5, "Above Healthy",

    'Table'[Net Qty] > 0, "Healthy Level",

    "Unhealthy Level"

)

 

Please refer to the screenshot given below,

 

SamInogic_0-1724741295867.png

 

Thanks!

 

Inogic Professional Services: Power Platform/Dynamics 365 CRM
An expert technical extension for your techno-functional business needs
Service: https://www.inogic.com/services/
Tips and Tricks: https://www.inogic.com/blog/

sorry. what i want is to use Healthy Qty. I forgot to point to Healthy Qty column instead. But if you change at ur end and you will notice is wrong as well

 

You may refer to the attached photo. As you can see i update the formula point to "heathy" column. The Heathy Level text column still doesnt display the correct text 

 

Untitled.png

Idrissshatila
Super User
Super User

Hello @kennylch ,

 

can you please point out what are the invalid results, because as per your measure, the result is correct.



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




hi.You are right. The measure number "Healthy" is correct with the calculation. But if you notice the PART : 00-200-1485. third row in the screenshot. Heathy is 0.76. It should be fall under "Unhealthy Level" in the healthy level column given the formula below. But it show "Above Healthy" instead. 

 

Healthy Level = SWITCH(
    True(),
    KFACTOR[Net Qty]>5"Above Healthy",
    KFACTOR[Net Qty]>0"Healthy Level",
    "Unhealthy Level"
)

Hello @kennylch ,

 

you're using in the dax the net qty and in the validation you're using another column.

 

the measure is correct, but if you want to compare the healthy column then you should include it in the dax instead of Net Qty.



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




Hi. Thanks for point out. i have accidentally change the formula to netqty before send out. You may try to point to healthy. It gives incorrect result as well

 

You may refer to the attached photo. As you can see i update the formula point to "heathy" column. The Heathy Level text column still doesnt display the correct text 

 

Untitled.png

Hello @kennylch ,

In the meassure you check the value [Net Qty].
You refer to the value 0.76 wich is the measure [Healthy].

Greets,

Ronald


Hi. Thanks for point out. i have accidentally change the formula to netqty before send out. You may try to point to healthy. It gives incorrect result as well. 

 

You may refer to the attached photo. As you can see i update the formula point to "heathy" column. The Heathy Level text column still doesnt display the correct text 

 

Untitled.png

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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