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

DAX CALCULATION % OF SALES

Hi guys, 

 

I do not get this to work.

 

I have created a hiearchy where the top level shows SALES, COGS,  PERSONNEL COSTS, OTHER EXTERNAL COSTS.

 

If you drill down, you can see all the accountnumbers tied to these classificaitons.

 

I am trying to create a DAX calculation which shows the % of Sales.

 

"% of Sales = SUM(Table1[Sales]) / CALCULATE(SUM(Table1[Sales]); Table1[Type] = "SALES")"

 

However, this works when looking at the top level, but when drilling down it no longer works.

 

Any ideas?? Smiley Happy

P&L2.pngP&L.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
RobinLindstroem Frequent Visitor
Frequent Visitor

Re: DAX CALCULATION % OF SALES

Putting the SUM in the values area, and "Show as percent of" grand total works. But I want to "show percent of" Sales which is the top row called "1. Intäkter".

 

So I put SUM in the values field and then I choose "show percent"  of  "1. Intäkter" a.k.a Sales.

 

This works until you want to drill down in the pivot table :/

Thanks for trying to help!

View solution in original post

2 REPLIES 2
Super User
Super User

Re: DAX CALCULATION % OF SALES

I would try just a simple SUM and then in the values area click the drop down on the field and choose "Show as" | "Percent of grand total". Otherwise, I would try:

 

% of Sales = SUM(Table1[Sales]) / CALCULATE(SUM(Table1[Sales]); ALLEXCEPT(Table1,[Type]))

I have book! Learn Power BI from Packt


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

Proud to be a Datanaut!

RobinLindstroem Frequent Visitor
Frequent Visitor

Re: DAX CALCULATION % OF SALES

Putting the SUM in the values area, and "Show as percent of" grand total works. But I want to "show percent of" Sales which is the top row called "1. Intäkter".

 

So I put SUM in the values field and then I choose "show percent"  of  "1. Intäkter" a.k.a Sales.

 

This works until you want to drill down in the pivot table :/

Thanks for trying to help!

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: 244 members 2,382 guests
Please welcome our newest community members: