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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
PHDurand
Helper I
Helper I

Keep all months & 2 years in chart bar

Hi community,

 

Let me share my issue with you: I want to show in a bar chart the sales from this year & prior year (calculated with a DAX formula SAMEPERIODLASTYEAR) by month.

I did it easily using slicer and selecting 2 years and showing the months.

But to make filtering easier for users, I would like to use a slicer and select only the last period I want to show (as the page also includes monthly data).

Below you see where I am in my report:

- On the top row, I nearly got what I want but to do so I need to select all the months in the current year.

- On the second row, it's the slicer as I would like it to be used (only selecting one month) but in this case, the charts are only showing one month.

- On the bottow row I tried to split the slicer (one for the year and one for the month). In this case I got all the months but only the current year (I'm loosing the prior year comparison).

Capture.JPG

 

Does anybody has an idea how to do it ? If not, I will need to use unfriendly slicers but at least it would work.

 

1 ACCEPTED SOLUTION
v-haibl-msft
Employee
Employee

@PHDurand

 

Could you please post some sample data for your tables, and the DAX formula for the measure?

You can take a look this thread to see if it helps.

You can also try to use the Timeline slicer so that you can select months just by dragging which should be easier.

 

Best Regards,
Herbert

View solution in original post

2 REPLIES 2
v-haibl-msft
Employee
Employee

@PHDurand

 

Could you please post some sample data for your tables, and the DAX formula for the measure?

You can take a look this thread to see if it helps.

You can also try to use the Timeline slicer so that you can select months just by dragging which should be easier.

 

Best Regards,
Herbert

Hi,

 

Thanks for the link. Indeed this solution applies very well to my issue. I created the same table and just adjust the measure and it works.

Thanks

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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