March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
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 |
---|---|
117 | |
77 | |
58 | |
52 | |
46 |
User | Count |
---|---|
171 | |
117 | |
63 | |
57 | |
51 |