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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
pbbeginner
New Member

How to write the DAX to calculate the percentage below ?

Good afternoon All,

 

Please help me to write the DAX to calculate the percentage with the table below?

 

I have the Report name "FISMA MFA" with Category_Index = 9 and FY24Q4 total value 8. and want to divided by "FISMA Organization Report.." with Category_Index = 1 and FY24Q4 total value 15.

How to write the DAX to tell PowerBI that you take the total value of Category_Index 9 divided by the Total value of Category_Index 1 = percentage.

Thank you so much for your help. 

 

pbbeginner_0-1742942140810.png

 

2 ACCEPTED SOLUTIONS
pankajnamekar25
Super User
Super User

@pbbeginner  

If the user wants to calculate the percentage of each value against the total in the matrix

DAX

Percentage Measure =

DIVIDE(

    SUM( 'HQ-ALL Category'[Value] ),

    CALCULATE( SUM( 'HQ-ALL Category'[Value] ), ALL( 'HQ-ALL Category' ) ),

    0

)

This formula calculates each value as a percentage of the overall total.

If they want to calculate the percentage within a specific quarter, they can modify it as:

DAX

Percentage by Quarter =

DIVIDE(

    SUM( 'HQ-ALL Category'[Value] ),

    CALCULATE( SUM( 'HQ-ALL Category'[Value] ), ALLSELECTED( 'HQ-ALL Category'[Quarter] ) ),

    0

)

This ensures that the percentage is calculated within each quarter.

Thanks,
Pankaj

If this solution helps, please accept it and give a kudos, it would be greatly appreciated.

View solution in original post

pbbeginner
New Member

@pankajnamekar25

Thank you so much for your assistance.  You are so awesome!!!

View solution in original post

4 REPLIES 4
pbbeginner
New Member

@pankajnamekar25

Thank you so much for your assistance.  You are so awesome!!!

pankajnamekar25
Super User
Super User

@pbbeginner  

If the user wants to calculate the percentage of each value against the total in the matrix

DAX

Percentage Measure =

DIVIDE(

    SUM( 'HQ-ALL Category'[Value] ),

    CALCULATE( SUM( 'HQ-ALL Category'[Value] ), ALL( 'HQ-ALL Category' ) ),

    0

)

This formula calculates each value as a percentage of the overall total.

If they want to calculate the percentage within a specific quarter, they can modify it as:

DAX

Percentage by Quarter =

DIVIDE(

    SUM( 'HQ-ALL Category'[Value] ),

    CALCULATE( SUM( 'HQ-ALL Category'[Value] ), ALLSELECTED( 'HQ-ALL Category'[Quarter] ) ),

    0

)

This ensures that the percentage is calculated within each quarter.

Thanks,
Pankaj

If this solution helps, please accept it and give a kudos, it would be greatly appreciated.

Hi @pankajnamekar25

 

I can calculate the total value of each Category_Index and manually divide each total value of Category_Index each other, such CAT1 (for Category_Index 1) / CAT9 (for Category_Index 9).  Do you have any DAX that can solve this problem in the fastest way?

 

pbbeginner_0-1743167706723.png

 

Good morning @pankajnamekar25 

 

I am sorry that the result is not correct.  I think it should relate to Category_Index in the DAX.  Can you check the DAX please?

 

I have the Report name "FISMA MFA" with Category_Index = 9 and FY24Q3 total value 6. and want to divided by "FISMA Organization Report.." with Category_Index = 1 and FY24Q3 total value 12.  So it should be 6/12

 

pbbeginner_0-1743166763145.png

 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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
Top Kudoed Authors