cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jamesarthur Frequent Visitor
Frequent Visitor

Need help in writing DAX Measure

Hello All,

              I have a table with columns Product, Amount Sales and Financial Month. I have created a measure to calculate percentage for each product.

Table.PNG

As seen in the table, I have product and for each product percentage is calculated. Now I need another calculation as if you take Product Beverage, then New Calculation= %M of Beverage/(%M of Beverage + % M of Dairy + %M of Chem+%M of Food+ %M of Pharma). Unknown is not considered. Same repeated for each Product except Unknown.

 

Is there any possible way to write a DAX Expression. Please help me with it.

 

Thanks,

James

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Need help in writing DAX Measure

Hi @Jamesarthur

Measure = [%M]/SUMX(FILTER(ALL(Sheet3),[Product]<>"Unknown"),[%M])

 

 4.png

 

 

Best Regards

Maggie

View solution in original post

2 REPLIES 2
Ross73312 Super Contributor
Super Contributor

Re: Need help in writing DAX Measure

I'd be expecting you want something like this:

New Calculation = var PctBeverage = CALCULATE(
	[%M],
	'YourTable'[Product] = "Beverage"
)
var PctDenominator = CALCULATE(
	[%M],
	NOT 'YourTable'[Product] = "Unknown"
)
RETURN
DIVIDE(
	PctBeverage,
	PctDenominator
)

   

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

Proud to be a Datanaut!


   


Community Support Team
Community Support Team

Re: Need help in writing DAX Measure

Hi @Jamesarthur

Measure = [%M]/SUMX(FILTER(ALL(Sheet3),[Product]<>"Unknown"),[%M])

 

 4.png

 

 

Best Regards

Maggie

View solution in original post

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 66 members 1,218 guests
Please welcome our newest community members: