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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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