Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hello,
i've a mesure for sales this year, and i've calculated sales for last year, with "dateadd -1 year".
I've the Date filter, filtered for the year 2021, and when i want to create a Line and clustered column chart with the 2 metrics, it only shows the value for 2021. The only wait to appear the values for 2020, is to chage de filter to the biggining of the year 2020.
What i'm doing wrong ?
thanks,
JR
Hi @jppuam !
You are using the same Date dimension attribute to filter the measure & plot a combo chart.
Please create a Dummy Date column in your Fact Table which will be used for Role playing dimension and plot a combi chart against it. This will show values for both current & last year.
Regards,
Hasham
@jppuam , Based on what I got.
Trailing year measure means, Data of 2020 will show on the dates of 2021.
If select one year and want to display a trend of two years you need an independent table
Need of an Independent Date Table:https://www.youtube.com/watch?v=44fGGmg9fHI
Hello Amit,
i'm using a date table on the filter. I've watch the video, but i think thats quite not the same.
If i filter the date for 5 days, 15 days, or what i want, i have to have the sales from this year and the corresponding sales for the same period.
I dont know if is missing some from my view.
what appears to me is something like the attached image.
(the figure shows 1 bar and 1 line, but i've 2 bars and 2 lines)
thanks for the help,
JR
Hi @jppuam ,
You can refer the content in the following links to get it:
Comparing this year and last year measure on a bar chart
CREATING A POWER BI CHART COMPARING EACH YEAR VS PREVIOUS YEAR
1. Create a date dimension table
2. Create measure as below to get the value of previous year in same period
Total Sales Last Year = CALCULATE([Total Sales], SAMEPERIODLASTYEAR(Dates[Date]))
3. Create a line and column chart(Axis: the date field from Date dimension table)
Best Regards
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
93 | |
90 | |
84 | |
70 | |
49 |
User | Count |
---|---|
141 | |
120 | |
112 | |
60 | |
58 |