Forum Discussion
Data changing when adding legend
- 5 years ago
Hi Anonymous ,
Try the following formula:
Earliest_book = CALCULATE( MINX( ALLSELECTED('CALC NP''s (Uniek)'), 'CALC NP''s (Uniek)'[Datum boeking] ), GROUPBY( 'CALC NP''s (Uniek)', Datum[Week], 'CALC NP''s (Uniek)'[Patiëntnummer] ) )Count_Patiëntnummer = CALCULATE( DISTINCTCOUNT('CALC NP''s (Uniek)'[Patiëntnummer]), FILTER( ALLSELECTED('CALC NP''s (Uniek)'[Datum boeking]), 'CALC NP''s (Uniek)'[Datum boeking] = [Earliest_book] ) )If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
WinnizIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous ,
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:
- Anonymous5 years agoNot applicable
MFelix Thank you for your answer! It's much appreciated. Do you have any idea how I could resolve this? So the duplicates don't get shown when adding 'Gebruiker' to the legend?
- MFelix5 years agoSuper User
Hi Anonymous ,
Do you want to have the details but the total line label still be showned has you don't have the gebruiker? Or do you want the totals in gebruiker also to only add 19?
- Anonymous5 years agoNot applicable
I want to totals without Gebruiker as legend to be equal to the totals with Gebruiker as legend.