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.
I am having an issue with with displaying last year sales data that are grouped by their respective store locations.
I created the Measure LY Total Sales:
LY Total Sales = CALCULATE(sum(DailySales[Sales]),SAMEPERIODLASTYEAR(DailySales[DateKey]))
But when I used it in a Column chart distributed by the store location I get a chart that is the same level across all stores. Is there a way to properly represent each store's last year sales?
Solved! Go to Solution.
Hi Kashsks,
In your scenario, the issue can be caused by that the chart values are grouped for each X-axis group instance. You need to add a filter within the measure to filter corresponding values for each X-axis instance. Please follow the steps below:
1. Create two test tables.
Sales Record 2015:
Sales Record 2016:
2. Add a measure to Sales Record 2016 table and create the chart.
LY Total Sales = CALCULATE(SUM('Sales Record 2015'[Amount]),SAMEPERIODLASTYEAR('Sales Record 2016'[Date]),'Sales Record 2015'[Company]=VALUES('Sales Record 2016'[Company]))
If above is not help, could you provide the data struct about your tables?
Regards,
Xiaoxin Sheng
Hi Kashsks,
In your scenario, the issue can be caused by that the chart values are grouped for each X-axis group instance. You need to add a filter within the measure to filter corresponding values for each X-axis instance. Please follow the steps below:
1. Create two test tables.
Sales Record 2015:
Sales Record 2016:
2. Add a measure to Sales Record 2016 table and create the chart.
LY Total Sales = CALCULATE(SUM('Sales Record 2015'[Amount]),SAMEPERIODLASTYEAR('Sales Record 2016'[Date]),'Sales Record 2015'[Company]=VALUES('Sales Record 2016'[Company]))
If above is not help, could you provide the data struct about your tables?
Regards,
Xiaoxin Sheng
Hi Xioxin,
Your suggestion worked perfectly! Thank you so much!
I didn't create 2 tables (since both this year and last year's data sit on the same table), but the concept should be just the same:
LY Total Sales = CALCULATE(SUM(DailySales[Sales]), SAMEPERIODLASTYEAR(DailySales[trxdate]),DailySales[STORE] = VALUES(DailySales[STORE]))
Cheers~
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
100 | |
80 | |
64 | |
57 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |