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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
RE_AM
Frequent Visitor

DAX Count total based on a measure

I have two matrix tables, one with the properties, in it shows the count of total residents that make up money owed in that property.  In the matrix below it, the resident detail from the property selected above (if no property is selected, it just shows all residents).  My issue is that i wrote a measure so that you can see the number of residents tied to a property -- but it doesnt match the "Check", which is a count column in the resident matrix below.

 

My MEASURE for the "# Residents Past Due" is:

count of past due residents =
CALCULATE(DISTINCTCOUNTNOBLANK('Tenant AR'[Current Owed]), FILTER ('Tenant AR', DATESINPERIOD ('Tenant AR'[As of] , MAX ('Tenant AR'[As of]), -1, MONTH )))
 
My "Current Owed" Measure is:
_CM Current Owed = CALCULATE (
    SUM ( 'Tenant AR'[Current Owed] ),
    DATESINPERIOD ('Tenant AR'[As of] , MAX ('Tenant AR'[As of]), -1, MONTH )
)
 
Note that the goal here is to count the number of residents that have a "_CM Current Owed" balance...so that the top matrix table count by property matches the detail matrix by resident for said property below...
 
Desired result is that the # Residents Past Due in the top matrix for the highlighted section would equal 304...because the count CHECK in the matrix below is correct.

 

 

RE_AM_0-1712520969667.png

 

 

THANK YOU!

 

1 REPLY 1
Anonymous
Not applicable

Hi @RE_AM ,

 

Make sure both matrices are run under the same filter context, especially regarding attribute selection and date period.

 

Try not adding the filter: "DATESINPERIOD ('Tenant AR'[As of] , MAX ('Tenant AR'[As of]), -1, MONTH )". See if the problem still exists.

 

Please provide me with test data, not in the form of screenshots, please remove any sensitive data in advance.

 

Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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