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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
GiTchitchinadze
Frequent Visitor

Selected Year Side By Side Comparison In chart

Hi guys,

 

I want to create a bar chart or any other chart that will include loss ratio data from two selected years. (for example, if i choose 2020 and 2022 it has to show both of them side by side). The problem is when I create a single date slicer and choose both years there's no side by side comparison, it's just a dynamic visualization of it (as first screenshot shows).Capture1Capture1

 

I want them to be side by side like next to 2019 qtr1 has to be second chosen year's first quarter results like its on the second screnshot. Loss ratio means Loss Amount divided by Sales Amount.Capture2.PNG

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

Hi @GiTchitchinadze ,

 

If you want the chart to display selected years side by side, you need to change your X-axis(remove year from the date hierarchy)

Based on your description, I have created a simple sample:

vjianbolimsft_1-1665456925731.png

Please try:

Loss Ratio = DIVIDE(SUM('Table'[Loss Ammount]),SUM('Table'[Sales Ammount])) 

Apply it to the visual:

vjianbolimsft_2-1665456995098.png

Then create a slicer for year:

vjianbolimsft_3-1665457059928.png

Final output:

vjianbolimsft_4-1665457081412.png

Best Regards,

Jianbo Li

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

View solution in original post

2 REPLIES 2
v-jianboli-msft
Community Support
Community Support

Hi @GiTchitchinadze ,

 

If you want the chart to display selected years side by side, you need to change your X-axis(remove year from the date hierarchy)

Based on your description, I have created a simple sample:

vjianbolimsft_1-1665456925731.png

Please try:

Loss Ratio = DIVIDE(SUM('Table'[Loss Ammount]),SUM('Table'[Sales Ammount])) 

Apply it to the visual:

vjianbolimsft_2-1665456995098.png

Then create a slicer for year:

vjianbolimsft_3-1665457059928.png

Final output:

vjianbolimsft_4-1665457081412.png

Best Regards,

Jianbo Li

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

amitchandak
Super User
Super User

@GiTchitchinadze , Try a trailing year measure with Date Table

 

Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Year))
Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),SAMEPERIODLASTYEAR('Date'[Date]))

 

or

Last year same QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(dateadd('Date'[Date],-1,Year)))

 

Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI :https://youtu.be/OBf0rjpp5Hw
https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5b...
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

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
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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.