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
Analitika
Post Prodigy
Post Prodigy

I can't exclude weekends from visual in Power BI

Hello,

 

I would like to ask how I could exclude weekends from the visual. X axis contains a column date of weekdays but in the visual I still see gaps of weekends in visual, so how fix this issue?

 

Analitika_0-1642142266676.png

18 and 19 days are weekend.
Here is a measure visual calculation:

Analitika_1-1642142345862.png

 



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

Hi @Analitika ,

 

It's weird.

Please create a flag measure:

Measure = IF(WEEKDAY(MAX('Table'[Date]),2) in {6,7},1,0)

And drag it to filter pane :

Eyelyn9_0-1642483054142.png

If it does not work as well, please provide a sample to help us clarify your scenario since you actual data is sensitive.

 

Change how visuals interact in a report - Power BI | Microsoft Docs

 

Best Regards,
Eyelyn Qin
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

14 REPLIES 14
ADDHOPE
Frequent Visitor

Hi,

 

You can change the X-axis type to Categorical instead of countinous. 

ADDHOPE_0-1693992852732.png

Regards

v-eqin-msft
Community Support
Community Support

Hi @Analitika ,

 

It's weird.

Please create a flag measure:

Measure = IF(WEEKDAY(MAX('Table'[Date]),2) in {6,7},1,0)

And drag it to filter pane :

Eyelyn9_0-1642483054142.png

If it does not work as well, please provide a sample to help us clarify your scenario since you actual data is sensitive.

 

Change how visuals interact in a report - Power BI | Microsoft Docs

 

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

ALLUREAN
Solution Sage
Solution Sage

In your date table if you have IsWeekday flag (1,0) then you can try using it as a filter in your visual to 1. Just a suggestion, not sure if this will help without look at your real data.




Did I answer your question? Mark my post as a solution!


https://allure-analytics.com/
https://www.youtube.com/channel/UCndD_QZVNB_JWYLEmP6KrpA
https://www.linkedin.com/company/77757292/

Proud to be a Super User!




I also tried this but it didn't change anything, not works as before

 

Hello,

 

Hello,

I would like if possible to exclude blank dates from visual, I made calendar table witch contains data without weekends but whener I use that date column in visual I still see gaps between dates in visual. So how resolve this issue?

Analitika_0-1642076871334.png

I marked the gap using blue marker. I can't a solution in order to exclude blank dates.

@Analitika , use a visual level filter , measure <> 0

Analitika_0-1642077756347.png

Not helped. I tried filtering like you said mentioning a mesure <>0 

Analitika_1-1642077811753.png

 

Analitika
Post Prodigy
Post Prodigy

Yes I did but it didn't change, didn't affect the visual.

Hi @Analitika 

 

Can you share your PBIX file?

 

Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

Why filtering don't affect visual?

No, I can't, it contains a lot of sensitive data.

ALLUREAN
Solution Sage
Solution Sage

Hi, @Analitika 

Did you try drop your measure into visual filter and set as Is not blank?




Did I answer your question? Mark my post as a solution!


https://allure-analytics.com/
https://www.youtube.com/channel/UCndD_QZVNB_JWYLEmP6KrpA
https://www.linkedin.com/company/77757292/

Proud to be a Super User!




Did anyone get this to work? I have the same issue, the suggested method doesnt seem to have any effect on removing the weekend gaps where there is no activity?

 

richrich123_0-1656666582871.png

 

Your measure is 0 for weekends, but your filter removes blanks. And PowerBI sees 0 as different from blank. Choose one of A and B:

solution option A: make your measure weekend return 1 or BLANK()

solution option B: filter by explicitly keeping only 1

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.