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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Saes
Helper I
Helper I

Calculating Percentage Measure with DAX

Hello all,

 

Can anyone help with a Percentage Measure calculation I'm struggling with? I have the following data which I'd like to show in a matrix table - a count of the number of products, by item name and whether the product is classed as above or below a certain criteria. This table works with no issues.

 

Product

Above

Below

Item 1

256

71

Item 2

456

177

Item 3

155

74

Item 4

25

314

Item 5

211

183

 

I'd like to turn it into a table to show percentages using a Dax formula, to show the following:

 

Product

Above

Below

Item 1

78.3%

21.7%

Item 2

72.0%

28.0%

Item 3

67.7%

32.3%

Item 4

7.4%

92.6%

Item 5

53.6%

46.4%

 

I've tried several Dax formulas, but I cannot replicate the table.

 

I know that I could use the 'show value as' option, but I'd prefer not to use this as I cannot format the percentages to 1 decimal place. Plus, I'd like to learn how to do this in Dax.

 

Can anyone help?

1 REPLY 1
amitchandak
Super User
Super User

@Saes , You need to create two measures

 

Above % = divide(sum(Table[Above]), Sum(Table[Above]) + Sum(Table[Below]))

 

Below % = divide(sum(Table[Below]), Sum(Table[Above]) + Sum(Table[Below]))

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.