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
slackerhx
Helper II
Helper II

Reading negative results as positive

Hi, 

 

I'm performing a series of calculations to generate a total result and seggregate the total result based on its values as negative, positive or neutral. 

 

However, I come to realise that even though the calculations gave the correct values but the DAX expression is unable to classify the values correctly according to the conditions that i've prescribed. 

 

To illustrate my point: 

 

Total = [Savings A] + [Savings B] + [Savings C]

 

where [Savings A], [Savings B], [Savings C] are calculated measures on their own. 

 

To classify the total value i've used the following DAX expression: 

 

Outlook = IF([Total]>0,"Savings",IF([Total]=0, "Neutral", IF([Total]<0, "Risks")))

 

However, some (not all) of the negative results (<0) from [Total] has been classified as "Savings".

 

I'm not sure why DAX failed to recognise those calculated results as "Risks", appreciate if anyone can enlighten me on this. 


Thank you. 

1 ACCEPTED SOLUTION
slackerhx
Helper II
Helper II

i finally found the issue... not sure if i'm able to explain clearly.. 

 

The measure that i was using were dependent on other measures (namely Savings A and B) which required dynamic What-If inputs. Thus, when the seggregation had to be evaluated on a row-by-row context, there isn't any default inputs to replace the What-if inputs. Hence, in a row context, the results cannot be evaluated effectively which makes it problematic when power BI had to classify the data according to the row condition that i've given.

 

Address   Total (as calculated column)           Total (as calculated measure) Savings A             Savings B       Savings C
8 Baker StreetInfinity3551020
21 Darling RoadInfinity7535400

View solution in original post

1 REPLY 1
slackerhx
Helper II
Helper II

i finally found the issue... not sure if i'm able to explain clearly.. 

 

The measure that i was using were dependent on other measures (namely Savings A and B) which required dynamic What-If inputs. Thus, when the seggregation had to be evaluated on a row-by-row context, there isn't any default inputs to replace the What-if inputs. Hence, in a row context, the results cannot be evaluated effectively which makes it problematic when power BI had to classify the data according to the row condition that i've given.

 

Address   Total (as calculated column)           Total (as calculated measure) Savings A             Savings B       Savings C
8 Baker StreetInfinity3551020
21 Darling RoadInfinity7535400

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.