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 want to have a measure which calculates Checkouts YTD - and this works well; and second measure which calculates Checkouts LYTD till the date I have data in fct table.
Checkouts =
CALCULATE(
COUNT(
'fct_Hotel Revenue'[Reservation Status Date]
),
'fct_Hotel Revenue'[Reservation Status Key] = 2
)
Checkouts YTD =
VAR _Max = MAX('fct_Hotel Revenue'[Reservation Status Date])
RETURN
CALCULATE(
[Checkouts],
DATESYTD(dim_Calendar[Date]),
dim_Calendar[Date] <= _Max
)
Checkouts LYTD =
VAR _Max = MAX('fct_Hotel Revenue'[Reservation Status Date])
RETURN
CALCULATE(
[Checkouts YTD],
SAMEPERIODLASTYEAR(dim_Calendar[Date]),
dim_Calendar[Date] <= _Max
)
The problem is with Checkouts LYTD:
First issue:
For table1 total should be 34480.
For table2 both numbers should be 34480.
Second issue:
Secondly the measure should be limited till 14th September. And Checkouts LYTD seems to be taking whole month instead of max calendar from;
For 2018 sales till August: 28146. Sales till 14th September: 2711. All together 30 857. In all above the number should 30 857 instead of 34 480.
What am I doing wrong?
https://drive.google.com/file/d/1_lyGKrXi-Kpn7AZkk8iu_jfQYOB_N2VC/view?usp=sharing
Pawel
Solved! Go to Solution.
Hi @gumis_rulez
you should update your LYTD measure as follows:
Hi @gumis_rulez
you should update your LYTD measure as follows:
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
23 | |
7 | |
7 | |
6 | |
6 |
User | Count |
---|---|
27 | |
12 | |
10 | |
9 | |
6 |