Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
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
Tracking On-time-check week country
11222 yes 14 DE
11222 no 14 DE
11232 yes 14 SE
11232 no 14 SE
Desired outcome
Tracking week country performace
11222 14 DE 50%
11232 14 SE 50%
Solved! Go to Solution.
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 _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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 _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
|
COUNTX(FILTER(...)...) or CALCULATE(COUNT(),FILTER(...)) |
(1) CO-CU Excel to DAX Translation - Microsoft Power BI Community
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 9 | |
| 6 | |
| 3 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 21 | |
| 14 | |
| 9 | |
| 5 | |
| 5 |