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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
bneuf
New Member

Group by year when no month is selected

Hello Community. I'm new to Power BI Desktop. I have created view where I am using two slicers (years and months) for the X axis. I want my chart to group by year when no months are selected. Currently, my chart looks exactly the same when all months or no months are selected. What am I missing? Can someone help?

powerbi.jpg

 

1 ACCEPTED SOLUTION
freginier
Solution Specialist
Solution Specialist

So everything works. You can't define a different agregation level (month / year) using a slicer

View solution in original post

4 REPLIES 4
Padycosmos
Solution Sage
Solution Sage

If you are using SWITCH() ,

SWITCH(<expression>, <value>, <result>[, <value>, <result>]…[, <else>])

In the else condition, you can use the measure [Total Sales], which would include Sales for all the years.

Though an unrelated video, you can see the above being used here

https://www.youtube.com/watch?v=inJ3Yt7ay30

 

freginier
Solution Specialist
Solution Specialist

By default the slicer select all data even if you don't choose an item, so empty or all selected it's the same.   

Does you slicer work when you select only one month ? 

Yes, if I selected one or multiple months, the data will segment to those months. For example, if I select "Janaury" with both years selected, I will see to bars - one for Janaury 2021 and another for Janaury 2022.

freginier
Solution Specialist
Solution Specialist

So everything works. You can't define a different agregation level (month / year) using a slicer

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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