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