Forum Discussion
Difficulties using VAR with a simple measure
- 8 years ago
VARIABLES are just a store of value. They do not store Expressions. So They are not dynamic like MEASURES
So Once you define a VARIABLE it is stored as a VALUE
So you are evaluating a fixed number when you are evaluating a VARIABLEi.e. something like this
CALCULATE(150000;FILTER(bookings;booking[reservationdate]<readingdatevar))
Yes sure, this is the table I take the data from (a simplified version). For each reservation there is one line for each day of stay; also reservation date is displaied.
1 more table for the reading dates that is a simple calendar; in fact I need to look at this data taking care of the reservation date, i.e. if looking at the "reading date" 15/07/2018 it should give me the total of the rooms that were already booked at that date.
The "date" column is linked to a simple calendar table; the "reservationdate" column is linked to the "reading dates" table.
The first formula gives me the desired results.
Tks!
Hi alecsonline
With Your provided sample i have done the same calculation and in both way the are same.
Could you please see and revert me is that your requirement or something diffrent.
I am attaching pbix file too with name Booking.pbix
Thanks and Regards,
Ravi
- Anonymous8 years agoNot applicable
- alecsonline8 years ago
Helper I
Thank you Ravik for your gift! It is true it works, but not when I modify it for my needings... my fault because I would not even be able to write them in a clear way. But your way to use the VAR is very useful and it is really a great help!
Alessandro