Forum Discussion
Georgetimes
2 years agoFrequent Visitor
Difference Sum between two dates - variable date
Hi everyone, needs your help with the below Don't know how I can attach a PBI, however please find two screenshots, one with a demo data and one with how this should look like. The easiest I ...
DataInsights
2 years agoSuper User
Try this measure. It requires two date tables (PeriodA, PeriodB) that do not have any relationships. Create each slicer using its corresponding date table. TREATAS changes the lineage of the date tables to the date in Bookings.
Bookings =
VAR vCountPeriodA =
CALCULATE (
COUNTROWS ( Bookings ),
TREATAS ( VALUES ( PeriodA[Date] ), Bookings[booking date] )
)
VAR vCountPeriodB =
CALCULATE (
COUNTROWS ( Bookings ),
TREATAS ( VALUES ( PeriodB[Date] ), Bookings[booking date] )
)
VAR vResult = vCountPeriodB - vCountPeriodA
RETURN
vResult