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

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

## Re: Need help in writing DAX Measure

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

Best Regards

Maggie

2 REPLIES 2
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

## Re: Need help in writing DAX Measure

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

Best Regards

Maggie

## Helpful resources

Announcements

#### Challenge: Can You Solve These?

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

#### Community News & Announcements

Get your latest community news and announcements.

#### 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.

#### Win Power BI Swag with Community Kudopalooza!

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

Top Kudoed Authors
Users Online
Currently online: 66 members 1,218 guests
Recent signins:
Please welcome our newest community members: