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

Get 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

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

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

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

 

 

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

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.