Forum Discussion
Countx with some conditions
- 7 years ago
Anonymous Please try below using "New Column"
ActualCount = CALCULATE(COUNTROWS(MatGroups),ALLEXCEPT(MatGroups,MatGroups[Country],MatGroups[Supplier]))
ExpectCount = CALCULATE(DISTINCTCOUNT(MatGroups[MatGroup]),ALLEXCEPT(MatGroups,MatGroups[Country],MatGroups[Supplier]))
Note - You can solve the same in "Power Query" as well using "GROUP BY" option..
Hope this helps !!
MarkLaf thanks for your reply;
Maybe I dont can explain me, Im looking when I filter country and supplier show me the count of diferentes mat_groups, for example
Country Supplier Mat_group
US A 123
US A 123
US A 456
US B 123
When I filter US and Supplier A, I want to see in count column 2 (the two diferent mat_group) and when y filter supplier B i want to see count 1 (mat_group 123)
I have more columns in the table, almost 150
I dont use the solution in the report layer, because with the information im going to do another calculations before show in the report layer.
Thanks again
Monica
Anonymous Please create a "New Measure" as below:
CntMsrGrps = DISTINCTCOUNT(MatGroups[MatGroup])
- Anonymous7 years agoNot applicable
PattemManohar thanks a lot for you reply.
Is possible to do this in a column? I want to have the value in a column because I need for another calcutations.
I tried this solution in a column but it doesnt work that I want.
Thanks Again
Monica
- PattemManohar7 years ago
Community Champion
Anonymous Please try below using "New Column"
ActualCount = CALCULATE(COUNTROWS(MatGroups),ALLEXCEPT(MatGroups,MatGroups[Country],MatGroups[Supplier]))
ExpectCount = CALCULATE(DISTINCTCOUNT(MatGroups[MatGroup]),ALLEXCEPT(MatGroups,MatGroups[Country],MatGroups[Supplier]))
Note - You can solve the same in "Power Query" as well using "GROUP BY" option..
Hope this helps !!
- Anonymous7 years agoNot applicable