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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Share per brand of total sales

Hello!

 

I would like to make a table but I don't know if it is possible. With below dataset (end of the message) I can make the following matrixes:

 

Maartjevd_0-1623938010808.png

So in here you can see all brands and the share of that brand of the total sales. It is filtered on the highest sales in 2020 with the following DAX: 

Salessum =
IF(
HASONEVALUE('Testfile 2'[Fiscal Year]),SUM('Testfile 2'[Sales]),
CALCULATE(SUM('Testfile 2'[Sales]),'Testfile 2'[Fiscal Year] = 2020))
 
And I made the following matrix:
 
Maartjevd_1-1623938102009.png

This is the same matrix but then only with the top 3 brands. 

 

But I want to see a combination of the 2 matrixes: I want to see the sales numbers from the second matrix and the % share numbers from the first matrix so that I know how much sales we do with the top 3 brands. In the end it will look like this:

Maartjevd_2-1623938330438.png

The 49% is the share of the 3 brands from the total sales of 23.500 in 2020.

 

I hope this is possible.

 

Thanks a lot!

Maartje

 

 

Fiscal YearBrandSales
2019A1000
2019A800
2019A1100
2019A1200
2019B600
2019B1500
2019B900
2019B1300
2019C1400
2019C500
2019C300
2019C800
2019D1400
2019D300
2019D1500
2019D1100
2019E300
2019E1500
2019E1100
2019E1000
2019F200
2019F400
2019F100
2019F300
2019G1000
2019G900
2019G700
2019G800
2019H200
2019H200
2019H200
2019H200
2020A800
2020A500
2020A1200
2020A600
2020B1000
2020B900
2020B1000
2020B1200
2020C800
2020C400
2020C800
2020C1100
2020D600
2020D1100
2020D900
2020D800
2020E1200
2020E500
2020E800
2020E800
2020F200
2020F100
2020F100
2020F100
2020G1000
2020G1500
2020G700
2020G800
2020H800
2020H800
2020H200
2020H200
7 REPLIES 7
ryan_mayu
Super User
Super User

@Anonymous 

pls see the attachment below





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

Proud to be a Super User!




Anonymous
Not applicable

Hi @ryan_mayu,

 

Thanks for your help. This is indeed what I wanted but I also want to rank it on sales in 2021 and I only want to see the sales for the weeks in the filter. I figured that out by making the following formula (Because I have some other tables etc in my real dataset it might look a bit different): 

 

Share '21 = [Ecom Value 2021]/CALCULATE(SUM(Actuals[ value ecom ]), FILTER(ALL(Actuals), Actuals[Fiscal Year] = max(Actuals[Fiscal Year]) && Actuals[Fiscal Week Number]<=max(Actuals[Fiscal Week Number])))
 
Ecom value 2021 is also a calculation: 
CALCULATE([Total Value Ecom],Actuals[Fiscal Year] = 2021)
 
But besides this, I want the formula to look at 1 other thing: I have a filter of shipment type and in here I have 1 shipment type I want to exclude at any time. So I thought I had to add FILTER (ALLSELECTED) for this one, but that doesn't work. 
 
So the above formula is working but I want to add the following filter:
 
Maartjevd_0-1624265298035.png

In which CL is excluded but the rest is included. 

 

Any idea how I can do that?

 

Thanks a lot!

Maartje

 

Hi @Anonymous,

Perhaps you can try to write a measure formula with date function to filter records and use it on 'visual level filter'.

Applying a measure filter in Power BI - SQLBI

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

@Anonymous 

have you tried allexcept(actual,[shipment type])





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

Proud to be a Super User!




Anonymous
Not applicable

@ryan_mayu 

 

I did change the formula now to ALLEXCEPT and it is working with all the other filters but it is not working with the filter Shipment Type. I used the following formula:

Share '21 test = [Ecom Value 2021]/CALCULATE(SUM(Actuals[ value ecom ]), ALLEXCEPT(Actuals, Actuals[Shipment quantity], Actuals[Fiscal Year], Actuals[Fiscal Week Number],Actuals[ Business unit ]))
 
If I have these filters on:
Maartjevd_0-1624533598672.png

it gives this result (I removed the brand name in front of the Ecom value 2020 because that is sensitive information): 

Maartjevd_1-1624533632732.png

If I add CL in the filter, so I use the following filters:

Maartjevd_2-1624533840969.png

I do get 100%:

Maartjevd_3-1624533867454.png

If I change the week numbers or business unit, it is working. But I only get 100% if I select CL as well. Any idea?

 

Thanks!

@Anonymous 

based on the screenshot you provided in the last post. I think allselected should work for this.

Is it possible to remove sensitive data and provide the pbix file?





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

Proud to be a Super User!




Anonymous
Not applicable

@ryan_mayu 

 

It took a while because there was so much sensitive data in it that I had to rebuild everything. But now it seems like I can't attach the pbix. Do you know how I can do that in this forum?

 

Thanks a lot!

Maartje

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.