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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
iRuso
Regular Visitor

Weighted Distribution calculation

 

Dear all,

 I need help. 

I have a simple data model and have to calculate weighted distribution for products in stores per category.

 

 

WSD Calculation is very simple – I should sum StoreShare values only for stores Product has been sold at least ones.

Measure formulas I am using:

 

SV = CALCULATE(SUM(Sales[SalesVolume])+0)     
TotalStore = CALCULATE(SUM(Sales[SalesVolume]); ALLEXCEPT(Sales; Sales[Store]))

TotalCategory = CALCULATE(SUM(Sales[SalesVolume]); 
ALLEXCEPT(Sales;Sales[Product]); ALL(Sales))
StoreShare = DIVIDE([TotalStore];[TotalCategory])
WSD = IF(ISBLANK([SV]); 0; [StoreShare])

 

 

All calculations goes well exept the most important one. 

On my dashboard you can see what only Product4 should have 100% distribution, but I got 100% for every item.

Could you please help?

Thank you very much in advance

 

Capture21.PNG

Capture1.PNG

1 ACCEPTED SOLUTION

Hi @iRuso

 

Try this MEASURE for the CARD VISUAL

 

WSD =
CALCULATE (
    [Store Share],
    SUMMARIZE ( Sheet2, Sheet2[Store], "Share", [Store Share] )
)

View solution in original post

6 REPLIES 6
Ashish_Mathur
Super User
Super User

Hi,

 

Your question is not clear.  Share a dataset, explain the business question and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hello,

 

 

This is link to my dataset and template

https://drive.google.com/file/d/1uy1fpaoC3eJkCeeGZSWT2QXeZmCzEpql/view?usp=sharing

 

Bussines case:

 

Weighted distribution for Retail.

We have 5 different products on sales in Retail Chain.

Total category sales calculation is very simple - CALCULATE(SUM([SalesVolume]); ALL())

Total Sales per Store also is easy - CALCULATE(SUM([SalesVolume]); ALLEXECPT(Table;Table[Store]))

The percent share of each store is calculated as Total Store Sales / Total Category Sales.

Now then one product is selected Weighted Distribution is Sum of Store Share only for stores where selected Product has been sold.

In my example only Product4 should have 100% Weighted distribution, but I got 100% for all items.

 

Could you please help me with correct formula?  

 

Capture.PNG

 

Hi,

 

I still do nto understand your question.  Please show me what exact % are you expecting in the card visual when each store is selected.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hello,

 

For Product2 as showed above - Card Value should be 92.02.

This Sum of  store share values. 

 

Thank you in advance. 

Hi @iRuso

 

Try this MEASURE for the CARD VISUAL

 

WSD =
CALCULATE (
    [Store Share],
    SUMMARIZE ( Sheet2, Sheet2[Store], "Share", [Store Share] )
)

Great !

 

It was easy. Thank you a lot!

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.