power bi total

Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

Forum home » Delegate support and help forum » Microsoft Power BI training and help » Power BI - Total value of stacked bar chart changes when I add v

Power BI - Total value of stacked bar chart changes when I add v

resolvedResolved · High Priority · Version 2016

Michael has attended:
No courses

Power BI - Total value of stacked bar chart changes when I add v

When I create a stacked bar chart with a calculated field (sum of total sales values divided by the number of a specific type of item that have been purchased), I get an answer, which I have checked and is correct.

However, when I add a variable to the legend which contains a string field of the type of product for each row in my data, the total for the stacked bar changes to an incorrect number (becomes about 10% less).

Please can you help with why this happens and what I can do to fix this.

Thanks,
Michael

RE: Power BI - Total value of stacked bar chart changes when I a

Hi Michael,

Thank you for the forum question.

It is a difficult question to answer, because the answer depends on your data model.

The fields you add to the visuals must come from a dim table in your case from a table where the products are unique identified by a key which are related to the transactions in a fact table.

If this is the case already there can be other issues:

The products must be related to only approximately 90% of the transactions in your fact table. Or your transactions must be filtered by something else in you data model, Query editor, or measures.


Based on the information I have got from you in your question it is not possible unfortunately to give you a better answer.



Kind regards

Jens Bonde
Microsoft Office Specialist Trainer

Tel: 0207 987 3777
STL - https://www.stl-training.co.uk
98%+ recommend us

London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector

RE: Power BI - Total value of stacked bar chart changes when I a

Hi Jens,

Thanks for getting back to me. Is there a way that I can send you some information related to my model to help explain?

To clarify:
- Each row in the table has the 'type' field which I am adding to the legend to try and split out the total.

- The variables added to the visual are all from the same table, so I don't think this can be caused by a lack of relation between tables - I assume having everything in one table is equivalent to having a list of variables in a dim table?

- With regards to filtering, the sole act of adding the type field to the legend changes the total despite not adding any more filters.

Many thanks,

Michael

RE: Power BI - Total value of stacked bar chart changes when I a

Hi Michael,

If all data is in the same table. Do you have many rows with the same Type?

If you have many rows with the same Type, does your measure look something like this:

=Divide(Sum([Sales]),Distinctcount([Type]),0)

Can I ask you to show me your measure please.


We have an email address: info@stl-training.co.uk



Kind regards

Jens Bonde
Microsoft Office Specialist Trainer

Tel: 0207 987 3777
STL - https://www.stl-training.co.uk
98%+ recommend us

London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector

RE: Power BI - Total value of stacked bar chart changes when I a

Hi Jens,

Yes, my measure was calculated as you have put above, but your comments have helped me to find the answer - I had too many different values for 'type', so the data was only being shown for the first 'x' number of types.

Having combined different product types to reduce the number of them, the total value is back to where it was supposed to be.

Many thanks for your help.

Michael

RE: Power BI - Total value of stacked bar chart changes when I a

Thanks Michael,

Good you found the issue



Kind regards

Jens Bonde
Microsoft Office Specialist Trainer

Tel: 0207 987 3777
STL - https://www.stl-training.co.uk
98%+ recommend us

London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector

Mon 25 Nov 2019: Automatically marked as resolved.

 

Training courses

 

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.


 

Power BI tip:

Report and Visualization Shortcuts

Ctrl + Shift + P: Enter or exit Presentation mode.
Ctrl + Shift + V: Toggle between different visualization types.
Ctrl + G: Group selected visuals.
Ctrl + Shift + H: Hide or unhide selected visuals.
Ctrl + Shift + L: Lock or unlock selected visuals.

View all Power BI hints and tips


Server loaded in 0.08 secs.