Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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 |
---|---|
75 | |
74 | |
44 | |
31 | |
27 |
User | Count |
---|---|
99 | |
89 | |
52 | |
48 | |
46 |