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

Preparing for a certification exam? Ask exam experts all your questions on May 15th. Register now.

Reply
jppuam
Helper V
Helper V

Line and clustered column chart dont show metrics

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

4 REPLIES 4
HashamNiaz
Solution Sage
Solution Sage

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

amitchandak
Super User
Super User

@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

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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.

Untitled.png

(the figure shows 1 bar and 1 line, but i've 2 bars and 2 lines)

thanks for the help,

JR

 

 

Anonymous
Not applicable

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)

yingyinr_0-1640333582017.png

Best Regards

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

Check out the April 2025 Power BI update to learn about new features.

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

Find out what's new and trending in the Fabric community.