Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
Hello,
I am creating a report to monitor which of my organization's agency partners have updated the plans assigned to them. The records in the database source are the plans. Some agencies have multiple plans which can have different plan statuses (see "Fire" and "Police" in the sample table below - each agency is responsible for two plans). The three possible values for [Plan Status] are "Complete", "Extension "Requested", and "No Response".
| Plan ID | Plan Name | Agency | Plan Status |
| 1 | Continuity Plan | Fire | Complete |
| 2 | Snow Plan | Sanitation | Extension Requested |
| 3 | Software Plan | Fire | No Response |
| 4 | Rainy Day Plan | Police | No Reponse |
| 5 | Search & Rescue Plan | Police | Extension Requested |
I am attempting to create a new field in Power BI called [Agency Status] that reports on the agency level rather than the plan level. The [Agency Status] field should have the same values as the [Plan Status] field. The logic should follow:
Based on this logic (which I am happy to clarify, the following [Agency Status] values should be:
| Plan ID | Plan Name | Agency | Plan Status | Agency Status |
| 1 | Back-up Plan | Fire | Complete | Complete |
| 2 | Snow Plan | Sanitation | Extension Requested | Extension Requested |
| 3 | Snow Plan | Fire | No Response | Complete |
| 4 | Rainy Day Plan | Police | No Reponse | Extension Requested |
| 5 | Back-up Plan | Police | Extension Requested | Extension Requested |
As always, I am happy to provide additional detail. Thank you to all those souls who venture to help our a DAX newbie such as myself!
Try this calculated column
Agency Status =
VAR CountPlans =
CALCULATE (
COUNT ( Table_Name[Plan Name] ),
ALLEXCEPT ( Table_Name, Table_Name[Agency] )
)
VAR mytable =
FILTER ( Table_Name, Table_Name[Agency] = EARLIER ( Table_Name[Agency] ) )
RETURN
IF (
CountPlans = 1,
Table_Name[Plan Status],
IF (
CONTAINS ( mytable, Table_Name[Plan Status], "Complete" ),
"Complete",
IF (
CONTAINS ( mytable, Table_Name[Plan Status], "Extension Requested" ),
"Extension Requested",
"No Response"
)
)
)
Thank you for the reply, @Zubair_Muhammad. When I add in the necessary table/field names, the calculation is able to run. Unfortunately the values for the number of agencies categorized as each Agency Status are not correct - particularly the count of agenciesthat should fall under "Extension Requested" and "No Response". As I am a beginner in the world of DAX, could you please explain the logic associated with those 2 in the caluclation you shared?
Hi Lewis.......When I use your sample data I get correct results... See the pic below
Could you share a instance where you get the incorrect Agency Status..... I will try to work it out
Check out the April 2026 Power BI update to learn about new features.
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.
| User | Count |
|---|---|
| 48 | |
| 40 | |
| 38 | |
| 20 | |
| 16 |
| User | Count |
|---|---|
| 68 | |
| 66 | |
| 29 | |
| 26 | |
| 25 |