Forum Discussion

aysultaniya's avatar
aysultaniya
Frequent Visitor
3 years ago

sameperiodlast year

 It is urgent please help

 

I have data till 1st Aug 2023 in an Excel sheet. The remaining sheet is blank below the 1st AUg.

Slicer Selection:-
31st July 2023 to 1st August 2023

Date SUM Last Year

----- ------ --------

31/7/2022 8
1/08/2022 9

...

31/7/2023 7 8
1/8/2023 3 9

Required output Current_year 10 and last_year 17

But the output of last year is not 17 (more than this) because It is the sum of the whole of August not only the selected dates.

The remaining dates it is working well only the last date of the data is showing this error.

DAX Query Last_year = CALCULATE([Measure_sum],SAMEPERIODLASTYEAR([date]))
Also Used CALCULATE([Measure_sum],date add([date], -1, year))

Both have the same output.

4 Replies