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!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
I have 2 tables: HCR Intakes & Allegations. The are related to each other with a 1-many relationship using a field called Intake Id (HCR Intakes have many Allegations).
I am trying to obtain a count of the allegations for each Intake in HCR Intakes.
This is the measure I created and it is working, but I am still new to DAX and am wondering if this is an efficient way:
Allegation Count =
VAR xFilterAllegations = FILTER(Allegations,Allegations[Intake Id] = RELATED('HCR Intakes'[Intake Id]))
RETURN
CALCULATE(
COUNTROWS(RELATEDTABLE('HCR Intakes')),
xFilterAllegations)
Here are some sample tables:
HCR Intakes:
| Intake Id | Date Recieved |
| 1 | 1/1/2025 |
| 2 | 1/20/2025 |
| 3 | 3/5/2025 |
| 4 | 4/25/2025 |
Allegations
| Allegation No | Intake Id |
| A1 | 1 |
| A2 | 1 |
| A3 | 2 |
| A4 | 2 |
| A5 | 5 |
| A6 | 6 |
| A7 | 7 |
Expected outcome for Count of Allegations is: 4 (Intake Id 1 & 2 match HCR Intake [Intake id])
Solved! Go to Solution.
Hi,
I would reduce te measure to only
If this helped, please consider giving kudos and mark as a solution
@me in replies or I'll lose your threadconsider voting this Power BI idea
Francesco Bergamaschi
MBA, M.Eng, M.Econ, Professor of BI
Hi @Txtcher please try this
Thank you @FBergamaschi & @techies . Both solutions work. 😁
And, the measure I created was not working because it was counting intakes, not allegations. Doh!
Good grief.
Hi @Txtcher please try this
Hi,
I would reduce te measure to only
If this helped, please consider giving kudos and mark as a solution
@me in replies or I'll lose your threadconsider voting this Power BI idea
Francesco Bergamaschi
MBA, M.Eng, M.Econ, Professor of BI
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 3 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 19 | |
| 12 | |
| 11 | |
| 6 | |
| 6 |