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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
ghost10
Frequent Visitor

Exclude Holidays and Retrieve Previous day Value

Hi All,

 

I would need some direction on Additional logic on retrieving previous value. Requirement is to exclude Weekends and holidays  bring Friday Value over to Monday as Prev Value .

I already have weekend and holidays column as weekend_ind and holidays_ind.

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your datamodel looks like, but please try something like below whether it suits your requirement.

 

expected result measure: =
VAR _prevworkingdate =
    MAXX (
        FILTER (
            ALL ( 'Calendar' ),
            'Calendar'[Date] < MAX ( 'Calendar'[Date] )
                && 'Calendar'[holidays_ind] = "False"
                && 'Calendar'[weekend_ind] = "False"
        ),
        'Calendar'[Date]
    )
RETURN
    CALCULATE (
        SUM ( 'FactTable'[Quantity] ),
        FILTER ( ALL ( 'Calendar' ), 'Calendar'[Date] = _prevworkingdate )
    )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

2 REPLIES 2
v-yinliw-msft
Community Support
Community Support

Hi @ghost10 ,

 

Could you please provide some sample data for me to test?

Please remove sensitive data.

 

Best Regards,

Community Support Team _Yinliw

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

 

Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your datamodel looks like, but please try something like below whether it suits your requirement.

 

expected result measure: =
VAR _prevworkingdate =
    MAXX (
        FILTER (
            ALL ( 'Calendar' ),
            'Calendar'[Date] < MAX ( 'Calendar'[Date] )
                && 'Calendar'[holidays_ind] = "False"
                && 'Calendar'[weekend_ind] = "False"
        ),
        'Calendar'[Date]
    )
RETURN
    CALCULATE (
        SUM ( 'FactTable'[Quantity] ),
        FILTER ( ALL ( 'Calendar' ), 'Calendar'[Date] = _prevworkingdate )
    )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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