Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
I have sales in Invoice Line Items table with an invoice date and I need to sum those sales between two dates - the Check In and Check Out dates in the Hotel Reservation table. So essentially summing sales when the invoice date is on or between the check in and check out dates.
Solved! Go to Solution.
@M_BODNER , A new column Reservation
sumx(filter(Invoice, Invoice[Date]>= Reservation[Check in] && Invoice[Date]<= Reservation[Check out]), Invoice[Value])
or
Try a measure like
Sumx(Reservation,
sumx(filter(Invoice, Invoice[Date]>= Reservation[Check in] && Invoice[Date]<= Reservation[Check out]), Invoice[Value]) )
or
Sumx(Reservation,
calculate( sumx(filter(Invoice, Invoice[Date]>= Reservation[Check in] && Invoice[Date]<= Reservation[Check out]), Invoice[Value]) ) )
Thank you!!! Your second suggestion worked like a charm.
@M_BODNER , A new column Reservation
sumx(filter(Invoice, Invoice[Date]>= Reservation[Check in] && Invoice[Date]<= Reservation[Check out]), Invoice[Value])
or
Try a measure like
Sumx(Reservation,
sumx(filter(Invoice, Invoice[Date]>= Reservation[Check in] && Invoice[Date]<= Reservation[Check out]), Invoice[Value]) )
or
Sumx(Reservation,
calculate( sumx(filter(Invoice, Invoice[Date]>= Reservation[Check in] && Invoice[Date]<= Reservation[Check out]), Invoice[Value]) ) )
User | Count |
---|---|
98 | |
90 | |
82 | |
73 | |
67 |
User | Count |
---|---|
115 | |
102 | |
98 | |
71 | |
67 |