Forum Discussion
Juju123
2 years agoHelper III
CountRow return wrong result
Hi, I have this table : I create this measure in dax : COUNTROWS(FILTER(VALUES('TABLE'[Référence]),[Difference_test]<>0)) The result I should have is 27 but Power BI gi...
- Anonymous2 years ago
Hi Juju123 ,
I tested using the pbix file you gave me.
Because your data is so large, I created a slicer using the ‘Reference’ column and the ‘Annee’ column for display:You can use the following DAX to create a measure:
Count Distinct Month = CALCULATE( DISTINCTCOUNT(Feuil6[Mois]), ALLSELECTED(Feuil6), 'Feuil6'[Année] = SELECTEDVALUE(Feuil6[Année]), 'Feuil6'[Référence] = SELECTEDVALUE(Feuil6[Référence]) )And the final output is shown in the following figure, as we mentioned earlier, 44030786AD:F8294-B673 appears in 8 months of 2023, so let's put this to the test:
Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
2 years agoNot applicable
Hi Juju123 - when you use the following:
VALUES('TABLE'[Référence])It is creating a table with only 3 rows. There 3 rows contain the distinct values in the Reference column.
You can fix the formula by simply referencing the TABLE
COUNTROWS(FILTER('TABLE'),[Difference_test]<>0))