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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Blue-Space_34
Frequent Visitor

Creating a dynamic DAX measure (percentage of total)

Hi all,

 

I am using a table visual and I need some help creating this DAX measure for the calculation of percentage of total (Quantity_1 over Quantity_2):

 

Percentage of total = DIVIDE(SUM(Quantity_1), CALCULATE( SUM(Quantity_2), ALL (Invoice), ALL(Type)))

 

This measure seems to work fine showing the right percentages when used in the table visual.

In fact, the table visual contains different fields, including Invoice and Type. Only using ALL in combination with these fields seems to show the right percentages. Without ALL, the numbers are not shown correctly.

 

However this measure is not "dynamic", because if you decide to add some new fields to the table visual, you will have to modify the measure adding ALL with the new fields you have added.

So how can we achieve this same result but in a more dynamic way, so you don't have to modify the measure formula for every new field added to the visual?

I don't want the measure formula to be dependent on every field added, because the final visual will use many fields.

N.B: Things I have tried include using ALLSELECTED and ALL with the entire table but these don't seem to work. However maybe there are different ways of using these functions, so I am open to suggestions.

 

Thank you in advance for your help!

1 ACCEPTED SOLUTION
Akash_Varuna
Super User
Super User

Hi @Blue-Space_34 The ALLSELECTED i suppose you would have used thatafter sum() ALLSelected() ? if yes could you try with RemoveFilters

View solution in original post

4 REPLIES 4
v-venuppu
Community Support
Community Support

Hi @Blue-Space_34 ,

I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please accept it as a solution and give it a 'Kudos' so other community members with similar problems can find a solution faster.

Thank you.

Regards,

Rama U.

v-venuppu
Community Support
Community Support

Hi @Blue-Space_34 ,

I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.

Thank you.

Regards,

Rama U.

v-venuppu
Community Support
Community Support

Hi @Blue-Space_34 ,

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.

 

Regards,

Rama U.

Akash_Varuna
Super User
Super User

Hi @Blue-Space_34 The ALLSELECTED i suppose you would have used thatafter sum() ALLSelected() ? if yes could you try with RemoveFilters

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors