Forum Discussion
DISTINCTCOUNT values difference between AXIS visual and card visual
- 6 years ago
Hi Anonymous ,
Here we go.
Measure 2 = VAR s = MAX ( Planilha1[Situação] ) VAR no = CALCULATETABLE ( VALUES ( Planilha1[Ordens] ), FILTER ( ALL ( Planilha1 ), Planilha1[Situação] <> s ) ) RETURN IF ( ISFILTERED ( Planilha1[Situação] ), CALCULATE ( DISTINCTCOUNT ( Planilha1[Ordens] ), FILTER ( Planilha1, NOT ( Planilha1[Ordens] IN no ) ) ), DISTINCTCOUNT ( Planilha1[Ordens] ) )Pbix as attached.
Number of ways. Most obvious is that you have a visual level filter on your column chart visual. Another way might be that the x-axis is coming from some other table and there are non-matching rows.
Hi, Greg!
Have no filter on my visual and neither other table over this.
Bellow samples of my dataset and PBIX to make it more easy to understand.
Dataset
https://drive.google.com/open?id=1Mhg0QPpPxTPxmo_q2OYYwLn4xbiV47J1
PBIX
https://drive.google.com/open?id=1IPeK7j5uDWIU2517T8D_7l6Lh5nmCtmh
Thanks for your help.
- az386 years ago
Community Champion
Hi Anonymous
you have exactly 12 Orders which connected with 2 different Situacaos (not sure how to write it correct 🙂 )
Of course, these orders are counted twice in chart - one for each Situacao
- Anonymous6 years agoNot applicable
Hi, az38
I found this same answer too.
Actually, I've twelve orders been counted twice by different situations (Haha, Situação = Situation.. sorry about that, I sent to a BR Forum too).
But I was trying to do a distinct one that ignore this "situation" thing and only count all distinct orders independent where it is (where is the context).
I don't even know if this will work fully.. but I wanna give a try before use a new dataset without these double orders.
(The original dataset came from my company and run by invoice and not by orders, so if I've to change it.. it'll take a while. And I don't wanna it).
Anyway, thanks for your help!
- v-frfei-msft6 years ago
Community Support
Hi Anonymous ,
Here we go.
Measure 2 = VAR s = MAX ( Planilha1[Situação] ) VAR no = CALCULATETABLE ( VALUES ( Planilha1[Ordens] ), FILTER ( ALL ( Planilha1 ), Planilha1[Situação] <> s ) ) RETURN IF ( ISFILTERED ( Planilha1[Situação] ), CALCULATE ( DISTINCTCOUNT ( Planilha1[Ordens] ), FILTER ( Planilha1, NOT ( Planilha1[Ordens] IN no ) ) ), DISTINCTCOUNT ( Planilha1[Ordens] ) )Pbix as attached.