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

Incorrect total in bar chart

Hi everyone,

We have a bar chart like: 

vrumay_0-1620929738616.png

The Total Data Label is showing a SUM of the values, however, if we change the chart type to Matrix, we see this:

vrumay_1-1620930137093.png


Which is what we are actually expecting to see. The measure run against the total of both categories, instead of a sum of two categories.

Is it possible to have the total label show what we expect? or is there a work around that we could use?

Thanks!

1 ACCEPTED SOLUTION
v-xulin-mstf
Community Support
Community Support

Hi @Anonymous

 

You can create a measure as:

Total = 
VAR __table = SUMMARIZE('Table1',[Teanologia],"_value",sum(values))
RETURN
IF(HASONEVALUE(Table1[Teanologia]),sum(values),SUMX(__table,[_value]))

 

Best Regards,
Link

 

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

3 REPLIES 3
Sandeep_PowerBI
Frequent Visitor

Hi Team,

 

I am getting incorrect values in Bar chart. Earlier same incorrect totals are showing in matrix visual then have written HasoneValue Dax with SUMX and corrected. Now i am getting values error in Bar chart... In tooltip it showing correct value but data label showing wrong value. How to correct it? Attahced screenshot for reference...

When i am changing the slicer, as per table visual its correct but bar chart showing all incorrect values data lable. but if i take cursor on bar it hover showing right values... Feb - correct value is 0.03 but in bar its showing 0.028

Sandeep_PowerBI_0-1687285698043.png

 

Thank in advace!

 

Sandeep

v-xulin-mstf
Community Support
Community Support

Hi @Anonymous

 

You can create a measure as:

Total = 
VAR __table = SUMMARIZE('Table1',[Teanologia],"_value",sum(values))
RETURN
IF(HASONEVALUE(Table1[Teanologia]),sum(values),SUMX(__table,[_value]))

 

Best Regards,
Link

 

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

HashamNiaz
Solution Sage
Solution Sage

Hi !

Try putting the same measure for secondary axis. Use [Line & Stack Column] chart, and put the same measure for both primary & secondary Y-axis value. Primary axis will show data based on Technologia information, while seconday axis will show overall value. You can hide the secondary axis lin & only show data values.

 

Hope this will resolve the issue.

 

Regards,

Hasham

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.