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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.