Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi - I'm an experienced Excel VBA user but new to Power BI.
I have daily sales data from a single outlet/branch in one table and the monthly national sales for the whole company in another table.
eg:
TABLE 1
BRANCH A SALES
2nd Jan 2019 50 sold
5th Jan 2019 46 sold
10th Jan 2019 4 sold
TABLE 2
COMPANY TOTAL SALES
January 2019 1000 sold
The tables both go into February, March, etc.... and will continue into 2020, 2021 etc.
I want to create a column in either of the tables to show the percentage of the BRANCH sales, compared to the companies total sales.... so, for January, as the company sold 1000 of the product, and Branch A sold 100 of the product, somewhere there should be "JANUARY: 10%"
How could I achieve this with DAX or Power Query M please?
Solved! Go to Solution.
Hi @Anonymous ,
Sorry to reply you late. Based on my test, you could refer to below stpes:
Sample data:
Use below calculated column:
Percentae = CALCULATE(SUM(Table1[Sales]),FILTER('Table1',MONTH('Table2'[Company])=MONTH('Table1'[Branch])))/[Sales]
Now you could see the result:
You could aslo download the pbix file to have a view.
Regards,
Daniel He
Hi @Anonymous ,
I could not clear with your desired result about:
I want to create a column in either of the tables to show the percentage of the BRANCH sales
Could you please post your desired result if possible?
Regards,
Daniel He
@v-danhe-msft - Did my extra description help describe the outcome which I'm hoping for?
@v-danhe-msft - Did my extra description help describe the outcome which I'm hoping for?
Hi @Anonymous ,
Sorry to reply you late. Based on my test, you could refer to below stpes:
Sample data:
Use below calculated column:
Percentae = CALCULATE(SUM(Table1[Sales]),FILTER('Table1',MONTH('Table2'[Company])=MONTH('Table1'[Branch])))/[Sales]
Now you could see the result:
You could aslo download the pbix file to have a view.
Regards,
Daniel He
Hi @v-danhe-msft Daniel - ultimately, I'd be looking to create a vertical bar graph with January, February, March etc along the bottom, with bars showing the percentage of The Branches sales each month, compared to the whole companies sales for each month.
eg: In January, the branches sales accounted for 10% of the companies sales, in February, the branches sales were 12% of the companies sales ...and so on.
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
64 |
User | Count |
---|---|
135 | |
122 | |
101 | |
71 | |
61 |