cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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

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

Helpful resources

Announcements
Community Highlights

Community Highlights

Find out what's new in the Power BI Community!

Summit North America

Power Platform Summit North America

Register by September 5 to save $200

Virtual Launch Event

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 113 members 1,821 guests
Please welcome our newest community members: