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
E12345
Resolver II
Resolver II

Need to calculate percentage of total and show using the sum of two columns against a third column.

Hi! 

I need a proper DAX function to display the percentage ratio of column C over (O + BA).
The data is already grouped (contained within a matrix chart), with each line representing a grouping. 

I am new to BI, please help me figure it out, thanks a million! 

The screenshot below shows the right data as an example - I need a DAX functuion that would represent Ratio C/(O+BA)% column.

 

 

Percentage Calc Question.png

1 ACCEPTED SOLUTION
aj1973
Community Champion
Community Champion

Hi @E12345 

DAX = 

       VAR _C = SUM (TABLE[column C])

       VAR _O_BA = SUM (TABLE[O]) + SUM (TABLE[BA])
       VAR _Result = DIVIDE( _C , _O_BA , 0)

 

      RETURN

 

_RESULT

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

View solution in original post

4 REPLIES 4
aj1973
Community Champion
Community Champion

Hi @E12345 

DAX = 

       VAR _C = SUM (TABLE[column C])

       VAR _O_BA = SUM (TABLE[O]) + SUM (TABLE[BA])
       VAR _Result = DIVIDE( _C , _O_BA , 0)

 

      RETURN

 

_RESULT

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

Hi Amine,

Thank you for your prompt reply, the function worked! I did not expect the answer to come from a simple SUM! Many many thanks! 😉

aj1973
Community Champion
Community Champion

Can you share a sample of your Model, please? it is hard for me to speculate.

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

Amine, the function worked! Thanks! I got it wrong at first but then I realized my mistake. All is well. 

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.