Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Data changing when adding legend

I have the following bar chart:   When I add a legend to this chart, the values change:   Does anyone know why this happens?  
  • MFelix's avatar
    5 years ago

    Hi @Sohan ,

     

    Believe this is a repetion of the post below please see the same answer I have posted on the previous post

    https://community.powerbi.com/t5/Desktop/Data-changing-when-adding-legend/m-p/1978919

     

    Your data is not changing you are changing the context of your data so that is why you are getting different results.

     

    In your case you are making the distintc count of patient Number when you have the calculation at the week level a single patient is consider only once even if he appears in more than one Gebruiker.

     

    However when you add the Gebruiker the context changes and you add a different level of details so now you are picking up the same patient number once for each Gebruiker.

     

    Let's look at the example below:

     

    If you select the patient 729-8773 on week 3 you have a single patient, however it is consider in 3 different Gebruiker so when you add the legend you get a total of 3 patients: