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, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
JaipalAnu
Helper II
Helper II

Chart should give the comparison between two years based on two plans selection

I am using Line and Clustered column chart, so I wanted to see the comparison of two years data based on two selected Plans.

Example : I am using two slicers - One slicer contains Plan 1 data, another contains plan 2 data (both plans depends on years)
Plan 1 contains 2020,2021
Plan 2 contains 2022,2023

When we select Plan 1 as  P2021 and Plan 2 as P2023 then it should give the comparison like below image. (Below image has 6 years data) But the comparison should gives based on two plans selection in two slicers and data should show for all the years.

Thanks is Advance

JaipalAnu_0-1695313673911.png

 

1 ACCEPTED SOLUTION
Ritaf1983
Super User
Super User

Hi @JaipalAnu 
I prepared a sample PBIX, you can download it, and check if it is helpful.

Link to the file 

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.

 

 

 

 

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

5 REPLIES 5
Ritaf1983
Super User
Super User

Hi @JaipalAnu 
I prepared a sample PBIX, you can download it, and check if it is helpful.

Link to the file 

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.

 

 

 

 

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

My Data is like this actually, it is not about years. it is just plans so it has to give comparison between to selected plans which we select in the slicers that has to show in the chart and it has to show for all the 10 years.

JaipalAnu_1-1695362170356.png

 

 

@JaipalAnu 
Can you share some dummy pbx / data table?

However, based on the pictures you attached, I am not sure what the data is and what you are trying to accomplish.

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Thanks for your reply!
The requitement is the slicer should be single selection, so need comparison between two slicers selections (Plan1 and Plan2)

amitchandak
Super User
Super User

@JaipalAnu , Make sure you are using a separate date or year table

 

This year =

var _max = maxx(summarize(allselected(Fact), Date[Year]), [Year])

return

calculate([meausre], filter(all(date), date[year] =_max) )

 

 

 

Last year =

var _max = maxx(summarize(allselected(Fact), Date[Year]), [Year])

return

calculate([meausre], filter(all(date), date[year] =_max-1 ) )

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

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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