Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
as per image ,
in april sales is till 9th apr 2023 but in previous year it was till 30th april
i want to calculate if in selected year/month my store is working till 10 days only then calculate sum of only 10 days in last year same month .
thanks in advance
@Dhrutivyasa-070 you can follow the below pattern
PY Sales =
VAR MaxDate = EDATE(MAX(Sales [Date]), -12)
VAR MinDate = EDATE(MIN( 'Calendar' [Date]), -12)
VAR LYDates =
DATESBETWEEN(
'Calendar' [Date], MinDate, MaxDate)
RETURN CALCULATE (
[Total Sales],
LYDates )
Please don't forget to accept my solution if it helps. Thanks
Tharun
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
33 | |
16 | |
13 | |
10 | |
8 |
User | Count |
---|---|
58 | |
19 | |
12 | |
11 | |
10 |