Forum Discussion
sameperiodTHISyear Time Filtering
- 7 years ago
Hi Anonymous,
I made one sample for your reference.
1. Create a CALENDAR table and create relationship with the fact table as below.
2. Create the measures as below.
Current Year's "burn rate" = var mind =CALCULATE(MIN('CALENDAR'[Date])) var maxd = CALCULATE(MAX('CALENDAR'[Date])) var thisyearmin = DATE(YEAR(TODAY()),MONTH(mind),DAY(mind)) var thisyearmax = DATE(YEAR(TODAY()),MONTH(maxd),DAY(maxd)) return CALCULATE(SUM(Table1[burn rate]),FILTER(Table1,Table1[date]>=thisyearmin && Table1[date]<=thisyearmax))Selected Period's "burn rate" = CALCULATE(SUM(Table1[burn rate]),USERELATIONSHIP('CALENDAR'[Date],Table1[date]))For more details, please check the pbix as attached.
Regards,
Frank
- 7 years ago
Hi Anonymous,
Does that make sense? If so, kindly mark my answer as a solution to close the case.
Regards,
Frank - Anonymous7 years ago
Hey, I really appreciate your help on this, this response got kicked by my spam filter for whatever the reason!
Nevertheless, thank you so much! Happy Holidays!
Hi Anonymous,
I made one sample for your reference.
1. Create a CALENDAR table and create relationship with the fact table as below.
2. Create the measures as below.
Current Year's "burn rate" = var mind =CALCULATE(MIN('CALENDAR'[Date]))
var maxd = CALCULATE(MAX('CALENDAR'[Date]))
var thisyearmin = DATE(YEAR(TODAY()),MONTH(mind),DAY(mind))
var thisyearmax = DATE(YEAR(TODAY()),MONTH(maxd),DAY(maxd))
return
CALCULATE(SUM(Table1[burn rate]),FILTER(Table1,Table1[date]>=thisyearmin && Table1[date]<=thisyearmax))
Selected Period's "burn rate" = CALCULATE(SUM(Table1[burn rate]),USERELATIONSHIP('CALENDAR'[Date],Table1[date]))
For more details, please check the pbix as attached.
Regards,
Frank
Hey, I really appreciate your help on this, this response got kicked by my spam filter for whatever the reason!
Nevertheless, thank you so much! Happy Holidays!