Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
htbull_
Frequent Visitor

Trouble aggregating Measure results in a Table

Hello all, 

 

I'm having some trouble in getting some measure results to accurately total and display across all of the desired reporting years. 

I have created a measure to count the rows with a table, which is based on a SaveDate that identifies whether or not a claim was open or closed at the time of reporting. 

htbull__0-1755107718193.png

Because there are multiple instances of a single claim number (for historical comparison purposes), I created a flag in order to filter the claim numbers on their most recent ID. I have provided the flag measure down below:

htbull__1-1755107857408.png

All claims have been counted as the latest version of their distinct number (using the flag measure above - using in filter pane) should tally up to determine how many claims were Open or Closed on any specific date. 

htbull__2-1755108520690.png


Is there a way to count the total across the years, filtering out claims accoring to their StatusID's?

 

 

1 ACCEPTED SOLUTION
DataSteward
New Member

Hi @htbull_ 
Please try this
_ClaimsOpened :=
CALCULATE(
COUNTROWS(ClaimInfoHistory),


FILTER(
ClaimInfoHistory,
[IsLatestClaimFlag] = 1 &&
ClaimInfoHistory[StatusID] = 352 
),

Ensure calendar relationship is used correctly
USERELATIONSHIP(ClaimInfoHistory[SaveDate], Calendar_History[Date])
)


_TotalClaimsOpened :=
CALCULATE(
COUNTROWS(ClaimInfoHistory),
FILTER(
ALL(ClaimInfoHistory), 
[IsLatestClaimFlag] = 1 &&
ClaimInfoHistory[StatusID] = 352
)
)


View solution in original post

4 REPLIES 4
htbull_
Frequent Visitor

Hey @DataSteward this worked as intended. Thanks!

v-veshwara-msft
Community Support
Community Support

Hi @htbull_ ,
Thanks for posting in Microsoft Fabric Community.

Just checking in to see if you query is resolved.

The approach suggested by @DataSteward  is correct. By having _ClaimsOpened respect the calendar relationship and flag logic, and _TotalClaimsOpened use ALL to ignore row context, the calculation ensures that the row-level results and the total are both evaluated correctly.

 

If you still need assistance, please let us know.
Thank you.

DataSteward
New Member

_ClaimsOpened :=
CALCULATE(
COUNTROWS(ClaimInfoHistory),


FILTER(
ClaimInfoHistory,
[IsLatestClaimFlag] = 1 &&
ClaimInfoHistory[StatusID] = 352 -- Adjust 352 to desired Open/Closed value
),

Ensure calendar relationship is used correctly
USERELATIONSHIP(ClaimInfoHistory[SaveDate], Calendar_History[Date])
)

_TotalClaimsOpened :=
CALCULATE(
COUNTROWS(ClaimInfoHistory),
FILTER(
ALL(ClaimInfoHistory), -- removes filters like year
[IsLatestClaimFlag] = 1 &&
ClaimInfoHistory[StatusID] = 352
)
)


Hi @htbull_ 


DataSteward
New Member

Hi @htbull_ 
Please try this
_ClaimsOpened :=
CALCULATE(
COUNTROWS(ClaimInfoHistory),


FILTER(
ClaimInfoHistory,
[IsLatestClaimFlag] = 1 &&
ClaimInfoHistory[StatusID] = 352 
),

Ensure calendar relationship is used correctly
USERELATIONSHIP(ClaimInfoHistory[SaveDate], Calendar_History[Date])
)


_TotalClaimsOpened :=
CALCULATE(
COUNTROWS(ClaimInfoHistory),
FILTER(
ALL(ClaimInfoHistory), 
[IsLatestClaimFlag] = 1 &&
ClaimInfoHistory[StatusID] = 352
)
)


Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.