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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Ritaf1983
Super User
Super User

Power BI Matrix: Dynamic Percentage Calculation Across Hierarchical Levels Using Field Parameters

Hi 🙂

I have a matrix visual analyzing employee costs based on three dimensions:

  • Site
  • Department
  • Gender

Each dimension is selected dynamically using Field Parameters.

My goal is to display, at each hierarchical level, the relative percentage of each row compared to the total of the opened hierarchy level. The expected behavior is demonstrated in the attached screenshot.

 

Ritaf1983_0-1742284399568.pngRitaf1983_1-1742284447255.png

 

The challenge arises because the order of selection can change.

  • Using a standard ISINSCOPE approach works only in one direction.
  • If a user drills down in an order different from my predefined conditions, the percentage calculation breaks.

    Ritaf1983_2-1742284499696.png

     

I attempted to concatenate the selected dimensions to determine the hierarchy dynamically, but the issue is that the engine does not order the concatenated string based on the selection order—it orders it based on the sorting logic of the Parameter Table.

 

Is there a DAX-based solution to dynamically adjust the calculation based on the actual drill-down path chosen by the user?

The pbix with the dummy data is attached

Any insights would be greatly appreciated

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile
1 ACCEPTED SOLUTION
Deku
Super User
Super User

I had a look

 

selectedParameter = TOJSON( Parameter )

 

Deku_2-1742289723006.gif

 

Using this we can see the parameters being applied. The problem is the result of the measure is always in the same order, even when the visual has memory of the order of selection.

 

If you look at the query you can see in the query that the visual knows the order. But can't see anyway to surface the filter ordering. Had a look at SQL post on Field Parameter, and there is already a comment that confirms 

 

Deku_1-1742289217118.png

 

 

 

 


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

View solution in original post

4 REPLIES 4
V-yubandi-msft
Community Support
Community Support

Hi @Ritaf1983 ,

We noticed we haven't received a response from you yet, so we wanted to follow up and ensure the solution we provided addressed your issue. If you require any further assistance or have additional questions, please let us know.

Your feedback is valuable to us, and we look forward to hearing from you soon.

V-yubandi-msft
Community Support
Community Support

Hi @Ritaf1983 ,

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

Thank you.

V-yubandi-msft
Community Support
Community Support

Hi @Ritaf1983 ,

@Deku , provided a good  response that meets your requirements ?  If you need any additional details or clarification, please feel free to reach out.

Is your issue resolved? If so, kindly mark the solution as accepted. This will help others with similar issues find the answer more easily.

 

 

Deku
Super User
Super User

I had a look

 

selectedParameter = TOJSON( Parameter )

 

Deku_2-1742289723006.gif

 

Using this we can see the parameters being applied. The problem is the result of the measure is always in the same order, even when the visual has memory of the order of selection.

 

If you look at the query you can see in the query that the visual knows the order. But can't see anyway to surface the filter ordering. Had a look at SQL post on Field Parameter, and there is already a comment that confirms 

 

Deku_1-1742289217118.png

 

 

 

 


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

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.