Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hello,
I have a table below with a list of ID and dates. A [BindingID] will be repeted for each [ReportingPeriod] if it has been picked in that month. The Binding ID will only apprea once for each month. I want to replicate the countifs formula I use in Excel in this table in PowerBI "=COUNTIFS($A$2:$A$586,A2,$C$2:$C$586,D2)"
So far I have this DAX function but it does not return anything. "
BindingID | DQItemID | ReportingPeriod | Last Month | Issue Last Month |
68 | 41 | 29/02/2024 | 31/01/2024 | 1 |
143 | 96 | 29/02/2024 | 31/01/2024 | 1 |
196 | 129 | 29/02/2024 | 31/01/2024 | 1 |
257 | 167 | 29/02/2024 | 31/01/2024 | 1 |
298 | 188 | 29/02/2024 | 31/01/2024 | 1 |
432 | 290 | 29/02/2024 | 31/01/2024 | 1 |
434 | 292 | 29/02/2024 | 31/01/2024 | 1 |
449 | 709 | 29/02/2024 | 31/01/2024 | 0 |
452 | 328 | 29/02/2024 | 31/01/2024 | 0 |
461 | 310 | 29/02/2024 | 31/01/2024 | 1 |
477 | 548 | 29/02/2024 | 31/01/2024 | 1 |
479 | 549 | 29/02/2024 | 31/01/2024 | 1 |
512 | 329 | 29/02/2024 | 31/01/2024 | 0 |
555 | 710 | 29/02/2024 | 31/01/2024 | 0 |
686 | 552 | 29/02/2024 | 31/01/2024 | 1 |
760 | 331 | 29/02/2024 | 31/01/2024 | 0 |
806 | 714 | 29/02/2024 | 31/01/2024 | 0 |
809 | 519 | 29/02/2024 | 31/01/2024 | 1 |
Thanks John
Solved! Go to Solution.
Ok so I decided to ask Microsoft Copilot and it actually worked. This is the solution:
Give this DAX measure a try
Issue_LastMonth =
CALCULATE(
COUNTROWS(dq_issues_tbl),
FILTER(
dq_issues_tbl,
dq_issues_tbl[BindingID] = EARLIER(dq_issues_tbl[BindingID]) &&
FORMAT(dq_issues_tbl[ReportingPeriod], "DD/MM/YYYY") = FORMAT(dq_issues_tbl[Last Month], "DD/MM/YYYY")
)
)
Thank you for the quick reply, unfortunatly it returns blank in the column.
@johnbird Seems like that would be expected behavior. None of your rows have a ReportingPeriod that is equal to the Last Month so it's going to filter out all rows.
Ok so I decided to ask Microsoft Copilot and it actually worked. This is the solution: