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
ExcelMonke
Resolver I
Resolver I

Matrix Results and Bar Chart not Calculating the Same

Hello,

I am running into an issue where a measure that I have is behaving correctly within a Matrix. However, when in a barchart, the behaviour is not correct. 
This is the measure I am using for the "Distro_ClinPercent" column:

DIVIDE([ClinicVisits],CALCULATE(SUMX('TABLE',[ClinicVisits]),ALL('Table'[ApptLength])))

It gives me the following result:

ExcelMonke_0-1708710062179.png

However, in a bar chart, it looks like the clinic visits row just divides by itself, rather than the SUMX value. this results in a 100% result for each apptlength category.

ExcelMonke_1-1708710126293.png

 

How do I correct this behavior? 

1 ACCEPTED SOLUTION
ExcelMonke
Resolver I
Resolver I

thanks everyone for the input. I managed to figure it out, and it was really my mistake... I figured out that the x-axis was not properly connected to the model. Once I did that it all worked.

View solution in original post

4 REPLIES 4
ExcelMonke
Resolver I
Resolver I

thanks everyone for the input. I managed to figure it out, and it was really my mistake... I figured out that the x-axis was not properly connected to the model. Once I did that it all worked.

v-xuxinyi-msft
Community Support
Community Support

Hi @ExcelMonke 

 

Do you use the visualization shown below? As you can see below, I put in two measures, and the visualization calculates the ratio of each of the two measures to the whole bar, and then displays them in different colors. A 100% stacked column chart is designed to illustrate the relative percentage of multiple data series in stacked columns. In this chart, the cumulative of the stacked columns always equals 100%. If you put in a measure, it will just show 100%.

vxuxinyimsft_1-1708925941282.png

 

vxuxinyimsft_2-1708926512108.png

 

You can use the stacked column chart to display the results you want.

vxuxinyimsft_3-1708926600570.png

 

If you are not using this chart, then could you provide a sample of the raw data so that we can better assist you?

How to provide sample data in the Power BI Forum - Microsoft Fabric Community . Or show it as a screenshot or pbix. Please remove any sensitive data in advance. If uploading pbix files please do not log into your account.

 

Best Regards,
Yulia Xu

 

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

amitchandak
Super User
Super User

@ExcelMonke , Try one of the two

 

DIVIDE([ClinicVisits],CALCULATE(SUMX('TABLE',[ClinicVisits]),ALL()))

 

DIVIDE([ClinicVisits],CALCULATE(SUMX('TABLE',[ClinicVisits]),removefilters('Table'[Operation Group])))

Unfortunately neither of those worked. for context, the Operation Group is on a seperate table. The apptlength is from the fact table. 

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.