Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
erhan_79
Post Prodigy
Post Prodigy

Even Filtered , calculating previous days

Hi There ; 

 

I have an excel data as below , basicly material , delivery date , and quantities , imagine that i am creating a table visiual  and adding a filter pane  on visiual filter as "Delivery Date " = related date and this month , table dinamicly shows this month's quantities.

 

cap-1.JPG

 

 So then i remove material and delivery date headers from table so table shows totaly 200+ 300 + 700 = 1200  Quantities on table  , but i would like to create two  measure  ; 

 

  • first measure : even date filtered on  visual like this month dinamicly , a measure will calculate actual month's quantity + all before month's  quantities . So measure will sum  : 200+300+700+ 400 + 600
  • second measure : even date filtered on  visual like this month dinamicly , a measure will calculate quantities which one of them' s dates includes before 15 days then today , so measure will sum  :  200 + 700 

Thanks in advance 

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@erhan_79 , I think first one cumulative

 

Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(all('Date'),'Date'[date] <=max('Date'[date])))

 

 

Second one can be

 

MTD Today =
var _min = eomonth(today(),-1)+1
var _max = today()
return
CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))

 

 

MTD Yesterday =
var _max = today() -1
var _min = eomonth(_max,-1)+1
return CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
erhan_79
Post Prodigy
Post Prodigy

hi @amitchandak  ;

 

Firts measure ok thanks but secaond measure i need dynamic , i mean ; 

 

if today is 30 december , system will calculate between 15 december and 30 december 

if today is 25 december , system will calculate between 10 december and 25 december 

if today is 13 december , system will calculate between 28 november and 13 december 

 

always dinamicly will calculate the quantities between today and 15 days before then today 

 

i hope it is clear 

amitchandak
Super User
Super User

@erhan_79 , I think first one cumulative

 

Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(all('Date'),'Date'[date] <=max('Date'[date])))

 

 

Second one can be

 

MTD Today =
var _min = eomonth(today(),-1)+1
var _max = today()
return
CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))

 

 

MTD Yesterday =
var _max = today() -1
var _min = eomonth(_max,-1)+1
return CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors