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
MarkusEng1998
Resolver II
Resolver II

Measure for Average of Total Areas is not filtering by the slicer

I have a matrix with projects in the columns, and rooms in the rows. The value is the program area. I have slicers for the region, program, etc. which filter out the projects and/or rooms.

 

I created a DAX measure _ProgAreaSum to calculate the average total program areas for the selected projects.

 

_ProgAreaSum = Calculate(Sum(_projRmTemplatesNormalized[rmProgArea]), ALLEXCEPT(_projRmTemplatesNormalized, _projRmTemplatesNormalized[Project]))/[_ProjCnt]

 

 

The dashboard shows that I used the Region slicer to display two projects. The expected value for _ProgAreaSum should be 916,542.5, not 33.35 million. The measure is taking the sum from all of the projects, not the two. And then is dividing by the _ProjCnt measure (2).

Program Area Measure Incorrect 2022-09-11_15-34-08.jpg

 

Please advise. I am confused about the proper DAX expression.

Thank you!

1 ACCEPTED SOLUTION
MarkusEng1998
Resolver II
Resolver II

I made this too difficult. I do not need the calculate in the function.

 

 

_ProgAreaSum = Sum(_projRmTemplatesNormalized[rmProgArea])/[_ProjCnt]

 

Solution provided by my colleague Robert Manna.

 

 

View solution in original post

3 REPLIES 3
MarkusEng1998
Resolver II
Resolver II

I made this too difficult. I do not need the calculate in the function.

 

 

_ProgAreaSum = Sum(_projRmTemplatesNormalized[rmProgArea])/[_ProjCnt]

 

Solution provided by my colleague Robert Manna.

 

 

v-rongtiep-msft
Community Support
Community Support

Hi @MarkusEng1998 ,

If I have not understood your meaning, there is some error on the measure total ?

I have found a sumilar post, please refer to it to see if it helps you.

Solved: How to remove duplicates count - Microsoft Power BI Community

_contract_ = var _a = '_projRmTemplatesNormalized'[_progareasum]
var _b = SUMMARIZE('_projRmTemplatesNormalized','_projRmTemplatesNormalized'[Program],"aaa",'_projRmTemplatesNormalized'[_progareasum])
return
IF(HASONEVALUE('_projRmTemplatesNormalized'[Program]),_a,averagex(_b,[aaa]))

 

If it still does not help, please provide your pbix file without privacy inforamtion.

 

Best Regards

Community Support Team _ Polly

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-rongtiep-msft , I wanted the average totals to be limited by the slicer. There are only two projects in the screenshot, but the average includes all of the projects.

 

btw. How do I attach a PBIX file?

 

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.