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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
p_kaushal
Frequent Visitor

How to keep total base constant from the data table

Hi I have a table with the below columns

Yearweeknumber (e.g. 201701)

Day text (Mon,Tues, Wed, Thurs)

Region

Store format

Channel

Competitor store

Product

Sales TY

Sales LY

 

I need to calculate a metric-Sales contribution by day.The formula in excel would be (Total sales TY-total sales LY)/Total Sales TY(for the respective day and week)

 

The denominator shouldn't change if I use other metrics such as product or region or channel.The numerator should change accordingly but the denominator i.e. the total sales for let's say Monday should remain the same irrespective of the change in categories we look at.

 

I would usually have a week no selected in the slicer when I look at contribution by day.

 

I have tried working this out and the below formula works where 'all store by day' is my table name.

Here I have put everything under the 'ALL' section other than Day_text and Week no,therefore it takes the correct base.

 

LFL contribution(by day) = (SUM('all store data by day'[LFL_Sales_SVTY])-SUM('all store data by day'[LFL_Sales_SVLY]))/CALCULATE(SUM('all store data by day'[LFL_Sales_SVTY]),ALL('all store data by day'[region],'all store data by day'[channel],'all store data by day'[competitor],'all store data by day'[store_affluence],'all store data by day'[store_format],'all store data by day'[psg]))

 

But,the issue arises when I try to get the same as I have a relationship between this table and another which is at 'PSG' level.The relationship between them is at psg level.If I take any other column from the other table to visualize my data my LFL contribution is incorrect as that column name is not in the ALL expression.

 

How do I make this ALL in the denominator include anything else from other tables too?

 

 

 

Thanks a lot!

 

 

 

2 REPLIES 2
v-qiuyu-msft
Community Support
Community Support


But,the issue arises when I try to get the same as I have a relationship between this table and another which is at 'PSG' level.The relationship between them is at psg level.If I take any other column from the other table to visualize my data my LFL contribution is incorrect as that column name is not in the ALL expression.

 

How do I make this ALL in the denominator include anything else from other tables too?


 

Hi @p_kaushal,

 

Can you share some sample data of 'all store data by day' table and the other table which has relationship use 'PSG'?

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-qiuyu-msft,

 

I have uploaded sample data here.  The first tab has the 'all store data by day ' I have mentioned and the second has 'PSG' level data.

 

When I use the above formula as mentioned in the first table it works fine.But when I take 'Junior Buyer' from the second table the %contribution numbers goes for a toss.The relationship between these two tables is on 'PSG'

 

 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.