Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers!
Enter the sweepstakes now!Preparing for a certification exam? Ask exam experts all your questions on May 15th. 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
Check out the April 2025 Power BI update to learn about new features.
Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.
User | Count |
---|---|
76 | |
72 | |
71 | |
48 | |
41 |
User | Count |
---|---|
54 | |
48 | |
33 | |
32 | |
28 |