Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!View all the Fabric Data Days sessions on demand. View schedule
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 November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 19 | |
| 11 | |
| 9 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 31 | |
| 27 | |
| 21 | |
| 13 | |
| 12 |