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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

How to Hide Useless Date Choices In Filter Box and X Axis

I use date table's Year & Month for the filter box to customer for report period selection, but the droplist shows all months of 2022, which only January has available data. I want to hide the choices from Feb.2022 to Dec.2022, please help me.

 

Xiumuzhai_0-1641861566981.png

 

I also want to remove useless months on X axis from Feb.2022 to Dec.2022. I can't use filter to remove the column values equal to zero because the values are not continuous.

Xiumuzhai_1-1641861876422.png

 

 

1 ACCEPTED SOLUTION

Hi, @Anonymous 

You can try formulas like the following:

inf = CALCULATE(Min('Table'[Date]),FILTER(ALL('Table'),'Table'[Value1]<>0||'Table'[value2]<>0))
sup = CALCULATE(Max('Table'[Date]),FILTER(ALL('Table'),'Table'[Value1]<>0||'Table'[value2]<>0))
filter = IF(SELECTEDVALUE('Table'[Date])>=[inf]&&SELECTEDVALUE('Table'[Date])<=[sup],1,0)

Then apply measure 'filter' to the filter pane of your chart.

Screenshot 2022-01-13 175730.png

Please check my attachment for more detail.

If it doesn't work, please share your sample file for further research. 

 

Best Regards,
Community Support Team _ Eason

View solution in original post

5 REPLIES 5
parry2k
Super User
Super User

@Anonymous I'm bit surprised why they are showing in the first place, what is the measure that you are using? Also, did you selected show all items with no data



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

This is a simple column chart linked one excel table, I use Excel column "cn_date" as time axis and the count of row with same day as measure. When I drilled down the column chart to show the sum count of each month, Power BI shows all months in the year on X axis, no matter it is blank or not.

 

Xiumuzhai_0-1641864629584.png

Xiumuzhai_1-1641864807750.png

 

 

Hi, @Anonymous 

You can try formulas like the following:

inf = CALCULATE(Min('Table'[Date]),FILTER(ALL('Table'),'Table'[Value1]<>0||'Table'[value2]<>0))
sup = CALCULATE(Max('Table'[Date]),FILTER(ALL('Table'),'Table'[Value1]<>0||'Table'[value2]<>0))
filter = IF(SELECTEDVALUE('Table'[Date])>=[inf]&&SELECTEDVALUE('Table'[Date])<=[sup],1,0)

Then apply measure 'filter' to the filter pane of your chart.

Screenshot 2022-01-13 175730.png

Please check my attachment for more detail.

If it doesn't work, please share your sample file for further research. 

 

Best Regards,
Community Support Team _ Eason

parry2k
Super User
Super User

@Anonymous you can add your measure as visual level filter with "is not blank" and that will do it.

 

 

Follow us on LinkedIn and YouTube.gif to our YouTube channel

 

Learn about conditional formatting at Microsoft Reactor

My latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

 

Not all blank months should be hided. For example as below, I want to hide both sides' blank months automaticly and keep the blank ones in the middle.

Xiumuzhai_0-1641863430072.png

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors