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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
Syndicate_Admin
Administrator
Administrator

Comparative graph between 2 years

Hello, I am new to PowerBi and I need your help.

I need to make a comparative graph between 2 years and I am not achieving it.

I have a sales table with date and years, I have added in my report the 2-year filter where the user must choose the years he wants to compare.

It happens that when I select the years in these filters (e.g. 2021 and 2022) and my graph goes blank, can they help me to achieve my goal please?

Thanks in advance

1 ACCEPTED SOLUTION
v-jayw-msft
Community Support
Community Support

Hi @Syndicate_Admin ,

 

I'd like to suggest you to create a independent slicer table:

Slicer = distinct('table'[year])

Then create a measure like below and add it to visual filter set value = 1.

Measure = IF(SELECTEDVALUE('Table'[year]) in VALUES(slicer[year]),1,0)
If I misunderstood your meaning, please share some sample data and expected result to us.
 
Best Regards,
Jay
Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

2 REPLIES 2
v-jayw-msft
Community Support
Community Support

Hi @Syndicate_Admin ,

 

I'd like to suggest you to create a independent slicer table:

Slicer = distinct('table'[year])

Then create a measure like below and add it to visual filter set value = 1.

Measure = IF(SELECTEDVALUE('Table'[year]) in VALUES(slicer[year]),1,0)
If I misunderstood your meaning, please share some sample data and expected result to us.
 
Best Regards,
Jay
Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
amitchandak
Super User
Super User

@Syndicate_Admin , if you have date, with help from date table or date of your table

 

Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(allselected('Date'),'Date'[date] <=max('Date'[date])))

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

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.

Top Solution Authors