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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anika3186
Frequent Visitor

Metric - two different data in two visuals

Hello,
I have a problem with two different visuals.
I have a metric „% Share Total.Sls Preisklasse“. I have this metric once in a table and once in a bar chart (when I change from bar chart to line chart I have the same problem)
Strangely, I get a different value in the "Preisbandbreite I = 8,01-9,00€", when using a filter, once 23.79% and once 30.86% (see third picture). I only have this difference with this one "Preisbandbreite I".
Below you find some screenshots to understand what I mean:

Anika3186_0-1678262635720.png

 


Below you will find the formulas behind the metric:

 

1) % Share Total.Sls Preisklasse = DIVIDE([Sales CY],[Total.Sls Preisklasse])

 

2) Total.Sls Preisklasse = CALCULATE([Sales CY],ALL(Umsatz_Absatzdaten[Preisbandbreite]))

 

3) Durchschnitts-VK-Preis SP = DIVIDE(Umsatz_Absatzdaten[Umsatz], Umsatz_Absatzdaten[Menge (Stück)])

 

4) Preisbandbreite = IF(Umsatz_Absatzdaten[Durchschnitts-VK-Preis SP]>18,"S = 18,01-25,00 €",

 IF(Umsatz_Absatzdaten[Durchschnitts-VK-Preis SP]>17,"R = 17,01-18,00 €",

 IF(Umsatz_Absatzdaten[Durchschnitts-VK-Preis SP]>16,"Q = 16,01-17,00 €",

 IF(Umsatz_Absatzdaten[Durchschnitts-VK-Preis SP]>15,"P = 15,01-16,00 €",

 IF(Umsatz_Absatzdaten[Durchschnitts-VK-Preis SP]>14,"O = 14,01-15,00 €",

 IF(Umsatz_Absatzdaten[Durchschnitts-VK-Preis SP]>13,"N = 13,01-14,00 €",

 IF(Umsatz_Absatzdaten[Durchschnitts-VK-Preis SP]>12,"M = 12,01-13,00 €",

 IF(Umsatz_Absatzdaten[Durchschnitts-VK-Preis SP]>11,"L = 11,01-12,00 €",

 IF(Umsatz_Absatzdaten[Durchschnitts-VK-Preis SP]>10,"K = 10,01-11,00 €",

 IF(Umsatz_Absatzdaten[Durchschnitts-VK-Preis SP]>9,"J = 9,01-10,00 €",

 IF(Umsatz_Absatzdaten[Durchschnitts-VK-Preis SP]>8,"I = 8,01-9,00 €",

 IF(Umsatz_Absatzdaten[Durchschnitts-VK-Preis SP]>7,"H = 7,01-8,00 €",

 IF(Umsatz_Absatzdaten[Durchschnitts-VK-Preis SP]>6,"G = 6,01-7,00 €",

 IF(Umsatz_Absatzdaten[Durchschnitts-VK-Preis SP]>5,"F = 5,01-6,00 €",

 IF(Umsatz_Absatzdaten[Durchschnitts-VK-Preis SP]>4,"E = 4,01-5,00 €",

 IF(Umsatz_Absatzdaten[Durchschnitts-VK-Preis SP]>3,"D = 3,01-4,00 €",

 IF(Umsatz_Absatzdaten[Durchschnitts-VK-Preis SP]>2,"C = 2,01-3,00 €",

 IF(Umsatz_Absatzdaten[Durchschnitts-VK-Preis SP]>1,"B = 1,01-2,00 €","A = 0,00-1,00 €"

))))))))))))))))))


Can someone help me and tell me why this is and what the cause is?
Thanks very much!
Anika

1 ACCEPTED SOLUTION
v-stephen-msft
Community Support
Community Support

Hi @Anika3186 ,

 

Are the fields in the bar chart on the right exactly the same as the fields in the table visual on the left, or are there some more fields in the bar chart?

It may be affected by other fields because of row context.

Try turning the bar chart on the right directly into a table visual to check if 30.86% has changed.

Row context in DAX - SQLBI

Context in DAX Formulas - Microsoft Support

Or does the bar chart contain visual-level filters?

[% Share Total.Sls Preisklasse], [Total.Sls Preisklasse], and [Durchschnitts-VK-Preis SP] are measure, [Preisbandbreite] is a calculated column, right? 

And [Preisbandbreite] is your x-axis in your bar char, right?

Sorry, I need more details about your issue. Take care to protect your privacy.

                                                                                                                                                         

Best Regards,

Stephen Tao

 

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

2 REPLIES 2
Anika3186
Frequent Visitor

Hi @v-stephen-msft 

 

yes, the fields in the table chart are exactly the same as in the bar chart. The only difference: there is an additional legend in the bar chart (brand name) => this legend cannot be seen in my screenshots because I wanted to ensure the private policy.

 

Both visuals are already filtered by "Brand" in the main filters anyway. The strange thing, and I believe this is the cause:

If I completely remove the legend (Brand) from the bar chart and only use the main filter "Brand", then I don't see any differences. If I have the legend "Brand" in it, then I get these differences.

 

What can be the cause of the error in this case?

 


[% Share Total.Sls Preisklasse], [Total.Sls Preisklasse] are measures, [Durchschnitts-VK-Preis SP], Preisbandbreite] are calculated columns,

 

[Preisbandbreite] is on the y-axis
[% Share Total.Sls Preisklasse] is on the x-axis

 

Thanks

Anika

 

v-stephen-msft
Community Support
Community Support

Hi @Anika3186 ,

 

Are the fields in the bar chart on the right exactly the same as the fields in the table visual on the left, or are there some more fields in the bar chart?

It may be affected by other fields because of row context.

Try turning the bar chart on the right directly into a table visual to check if 30.86% has changed.

Row context in DAX - SQLBI

Context in DAX Formulas - Microsoft Support

Or does the bar chart contain visual-level filters?

[% Share Total.Sls Preisklasse], [Total.Sls Preisklasse], and [Durchschnitts-VK-Preis SP] are measure, [Preisbandbreite] is a calculated column, right? 

And [Preisbandbreite] is your x-axis in your bar char, right?

Sorry, I need more details about your issue. Take care to protect your privacy.

                                                                                                                                                         

Best Regards,

Stephen Tao

 

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

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

Top Solution Authors
Top Kudoed Authors