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
v-fehum
New Member

Exclude Holidays as a Slicer by Market

Hello everyone,

 

I have a bar and line chart with day number on the x-axis and units sold on the y-axis. The line is a measure for how we are pacing towards the end of the month.

 

I need to add in holidays, by market, so I can exclude these days from the visual. 

 

I have an existing date, market, and holiday table with a 1:many relationship but this only filters by holiday dates and not market.

 

The holidays are by market, e.g. there is a row for Christmas for CA (Canada) and the US. Can anyone provide some tips on how to accomplish this?

Date Table.PNGHolidays.PNGMarket Table.PNG

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

Hi @v-fehum ,

 

One sample for your reference, Please check the following steps as below. If it doesn't meet your requirement, kindly share your sample data and excepted result to me. Please upload your files to One Drive and share the link here.

 

1. Create a calculated column in holiday table.

 

Month day = MONTH('Holiday'[Date])*100+DAY('Holiday'[Date])

2. Create a measure as below to get the excepted result.

 

Measure = 
CALCULATE (
    SUM ( 'Table'[Sold] ),
    FILTER (
        'Table',
        (
            MONTH ( 'Table'[Date] ) * 100
                + DAY ( 'Table'[Date] )
        )
            IN VALUES ( Holiday[Month day] )
            = FALSE ()
    )
)

 Capture.PNG

 

Pbix as attached.

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

1 REPLY 1
v-frfei-msft
Community Support
Community Support

Hi @v-fehum ,

 

One sample for your reference, Please check the following steps as below. If it doesn't meet your requirement, kindly share your sample data and excepted result to me. Please upload your files to One Drive and share the link here.

 

1. Create a calculated column in holiday table.

 

Month day = MONTH('Holiday'[Date])*100+DAY('Holiday'[Date])

2. Create a measure as below to get the excepted result.

 

Measure = 
CALCULATE (
    SUM ( 'Table'[Sold] ),
    FILTER (
        'Table',
        (
            MONTH ( 'Table'[Date] ) * 100
                + DAY ( 'Table'[Date] )
        )
            IN VALUES ( Holiday[Month day] )
            = FALSE ()
    )
)

 Capture.PNG

 

Pbix as attached.

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

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.