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
rlingua2234
Regular Visitor

Matrix Percentage using Measures for Totals

New to BI still getting used to DAX language.

 

Have the following data

 

Category = 01-SALES or 02-COGS

 

 

Branch  |     01-SALES    |   02-COGS     |  Total

------------------------------------------------------

031           190,351.86       (92,582.00)      97,769.86

032             84,748.25       (57,219.38)      27,528.87

 

Need the percentage  Total/01-SALES example above would be 51%.

 

I also need this to be able to change by slicer selection for example the amount in Matrix can change based on what is selected from slicer.

 

Any help would be much appreciated.

 

Thanks 

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @rlingua2234,

 

Although you have very limited information you need to make a measure that should look something like this:

 

% =
 ( SUM ( Table[01-Sales] ) + SUM ( Table[02-COGS] ) )
    / SUM ( Table[01-Sales] )

Then format as a percentage.

 

Concerning the second part what do you mean change it based on a slicer? What type of information as the slicer should have?

 

Regards

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

3 REPLIES 3
MFelix
Super User
Super User

Hi @rlingua2234,

 

Although you have very limited information you need to make a measure that should look something like this:

 

% =
 ( SUM ( Table[01-Sales] ) + SUM ( Table[02-COGS] ) )
    / SUM ( Table[01-Sales] )

Then format as a percentage.

 

Concerning the second part what do you mean change it based on a slicer? What type of information as the slicer should have?

 

Regards

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



I have the formula for total but need it to also by branch.

 

This formula works for the totals

 

divide (sum ('BranchProfit Month'[Amount]),CALCULATE(sum('BranchProfit Month'[Amount]),'BranchProfit Month'[Main account category] = "01-SALES"))

 

But how do i group it by branch? Thanks so much

So the slicer would be month, based on what month I'd select the numbers would change.

 

Also 01-SALES and 02-Costs aren't columns in data the column is Type and those are the fields in that Column.

 

I will attempt solution but I'm sure I will have to write it with Divide.

 

Yes you're correct that is the formula I want. Just don't know how to make it work with Power BI.

 

Thanks

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.