Forum Discussion
Spartanos
Helper II
4 years agoCountifs in DAX
Hi, I want to calculate the countifs on time and to late per country, per tracking nr and per week. Next, I would like to calculate a % of being on time per week and per country. Current data...
- 4 years ago
Hi Spartanos ,
According to your description, here's my solution.
Create a measure.
Performance = VAR _CY = COUNTROWS ( FILTER ( ALL ( 'Table' ), 'Table'[Tracking] = MAX ( 'Table'[Tracking] ) && 'Table'[Week] = MAX ( 'Table'[Week] ) && 'Table'[Country] = MAX ( 'Table'[Country] ) && 'Table'[On-time-check] = "yes" ) ) VAR _C = COUNTROWS ( FILTER ( ALL ( 'Table' ), 'Table'[Tracking] = MAX ( 'Table'[Tracking] ) && 'Table'[Week] = MAX ( 'Table'[Week] ) && 'Table'[Country] = MAX ( 'Table'[Country] ) ) ) RETURN DIVIDE ( _CY, _C )Get the correct result.
I attach my sample below for reference.
Best Regards,
Community Support Team _ kalyjIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Greg_Deckler
Community Champion
4 years ago|
COUNTX(FILTER(...)...) or CALCULATE(COUNT(),FILTER(...)) |
(1) CO-CU Excel to DAX Translation - Microsoft Power BI Community