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
nsingh07
Helper I
Helper I

Urgent help needed - Dynamic weighted averages based on multiple filter selections

Hi,

 

Need help in getting the logic for calculating the weighted average by Revenue at different aggregtion level. The weighted average should be dynamic based on the permutation & combinations through various filter selection ( have 8 filter on my view) Stating an example below:

1.JPG

 

 

At level 4, its a straight forward activity. However as I aggregate at Level 3/2/1, instead of having a straight line average, I need weightage average which should be dynamic based on my filter selection

2.JPG

3.JPG

 Incase, I select India in country filter, it should dynamically update the weighted average @ level 3 to 5.5 or 8 incase of US. Dynamic change should also apply if I include/exclude any row. Say, weighted average at level 2 for score 1 is 6. however this dynmically calculate if I excluded any of the level 4 based on any filter selection.

 

4.JPG

Inorder to relate the filter shown above to the example,

Business - Level 0

Pipeline - Level 1 

Product Line - Level 2

Product - Level 3

Project  - Level 4

 

Apologies, If I'm all over the place. have been breaking my head on this for past 2 days.

 

Looking for early help. THANKS IN ADVANCE

 

 

7 REPLIES 7
KMadsen
Regular Visitor

@nsingh07 , did you ever find a solution to your issue? I am stuck with the same questions right now.

v-lionel-msft
Community Support
Community Support

Hi @nsingh07 ,

 

Please refer to my .pbix file.

v-lionel-msft_0-1603422172045.pngv-lionel-msft_1-1603422190403.pngv-lionel-msft_2-1603422219412.pngv-lionel-msft_3-1603422235634.png

 

 

Best regards,
Lionel Chen

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

@v-lionel-msft  @Ashish_Mathur 

 

Thanks for the reply. Though this meets the desired result, UNPIVOT of data is not an option because report has multiple charts.

Instead, is it possible to get the result with a DAX calculation in the tabular form like in the example in my initial post.

For example: For Level3 weighted ratio(assume Level4 is lowest granular column), for each row I need

(revenue for that row) / (sum of revenue for corresponding Level3 value across entire dataset)

To elaborate further,
Level4 column, first row has value "A" and Revenue is "100" and corresponding Level3 value is "AA"
So, I would need:  

(Revenue corresponding to A)/ (sum of revenue corresponding to "AA" (Sum of Revenue for Level 4-A+Level 4-B)) = 100/110
 
The denominator should get updated with every slicer selection. For eg: if I deselect B from Level 4, the weighted ratio should be 100/100
ie  
(Revenue corresponding to A)/ (sum of revenue corresponding to "AA" (Sum of Level 4-A))
 
TIA
nsingh07
Helper I
Helper I

FYI, I'm new to Power BI hence a detailed post would be very helpful.

Thanks.

 

@Ashish_Mathur tagging you since saw few of your post on this topic.

 

@MattAllington 

Hi,

I have read your question a few times over but just cannot understand what you want.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

@Ashish_Mathur 

I need help indefining a logic / DAX to calculate the weighted average score at different aggregation level (1/2/3) dynamically based on the filter selection

Can someone please share the logic for calculating weighted average based on slicer selection

TIA

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.