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 September 15. Request your voucher.

Reply
Anonymous
Not applicable

DAX Measure not adding up for hierarcchies

Hi Experts

 

I cannot work out why the following DAX is not work for my hierarchies - i am trying to count the distinct values in column "latest result rating" where Operating effectively is present. 

 

as you can see for Spain ES Retail > STO 0012852 IKEA Madrid i should be see 37 as  a count but the currentr measure is giving 5. 

 

My Measure (Measurew Name _m_get_last_result)

 

VAR org = SELECTEDVALUE(vw_dim_msi_organization[level_5])
VAR ctrl= SELECTEDVALUE(vw_dim_msi_icontrol_controls[control_name])

VAR latest_assessed_on=MAXX(vw_fct_msi_icontrol_task_execution_assessments,vw_fct_msi_icontrol_task_execution_assessments[assessed_on])
 
 RETURN
COUNTX( vw_fct_msi_icontrol_task_execution_assessments,CALCULATE(SELECTEDVALUE(vw_fct_msi_icontrol_task_execution_assessments[assessed_on]), vw_fct_msi_icontrol_task_execution_assessments[assessed_on] = latest_assessed_on)

 

Sample Data 

 

https://www.dropbox.com/s/08twi0dir61pn5h/Sample_.pbix?dl=0https://www.dropbox.com/s/08twi0dir61pn5h... 

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

There is a lot of stuff going on in your data model. 

lbendlin_0-1684601624737.png

- Do not link fact tables directly

- avoid bidirectional links that point back into a dimension table.

 

Your sample file is too detailed - hard to find out what to look at.  Try distilling it down to the issue you are facing, remove everything that is unrelated.

 

View solution in original post

1 REPLY 1
lbendlin
Super User
Super User

There is a lot of stuff going on in your data model. 

lbendlin_0-1684601624737.png

- Do not link fact tables directly

- avoid bidirectional links that point back into a dimension table.

 

Your sample file is too detailed - hard to find out what to look at.  Try distilling it down to the issue you are facing, remove everything that is unrelated.

 

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.