The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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.
Solved! Go to Solution.
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 )
)
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.
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 )
)
User | Count |
---|---|
15 | |
8 | |
6 | |
6 | |
6 |
User | Count |
---|---|
24 | |
14 | |
13 | |
8 | |
8 |