Forum Discussion

1shix's avatar
1shix
New Member
3 years ago

Weighted Average

Hi, everyone!

 

I'm looking for a formula to do the split for the first ALLSELECTED Level (Level 1/Level 2), and then the values after that level, to reset to 1 for every sub-level (Slicer1, Slicer2 etc) that comes after it. For example, if we have a case where the initial split between Level 1/Level 2 is 0.4/0.6 these values for the split between Slicer1, Slicer2 etc should always reset back to 1.

 

This is what I've used so far:

WgAv = CALCULATE( DIVIDE( [Hours], CALCULATE( [Hours], ALLSELECTED('Split_Table'[Level 1 / Level 2), ALL('Split_Table'[Slicer1]), ALL('Split_Table'[Slicer2]) ) ),ALLEXCEPT('Split_Table','Split_Table'[Level 1 / Level 2]))

 

Here's a little example from Power BI. I marked with red the mistakes:

As you can see, in the Slicer 1.1.a, it didn't reset to 1, and at level 2, because it had 2 levels with 2 slicers, it didn't reset both of them, it reset just slicer 2.1.A.

1 Reply

  • 1shix The information you have provided is not making the problem clear to me. Can you please explain with an example.

    Appreciate your Kudos.