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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

filter with datesbetween

hi all,

 

i am having an issue with creating a table for filter, i believe i am missing something that causes the formula to fail.

sample data (date column is proper date in powerBI, below just for understanding):
date | profit
1jan | 10
2jan | 20
3jan | 30
4jan | 40

what i want to achieve is to add profits from 4jan to 2jan, and i have written a measure below, but it keeps failing - with error showing ' a table of multiple values was supplied where a single value was expected '

any help is much appreciated.

latest P&L =
CALCULATE( SUMXtable, [profit] ),
var starting= DATEADD[date] , -2 , DAY)
return
FILTER(
    enfusion_position_table, DATESBETWEEN([date] starting MAX([date]))
    )
    )



1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , with help from date table

example

Rolling 3 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],MAX('Date'[Date]),-3,day))

 

rolling Days Formula: https://youtu.be/cJVj5nhkKBw

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
amitchandak
Super User
Super User

@Anonymous , with help from date table

example

Rolling 3 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],MAX('Date'[Date]),-3,day))

 

rolling Days Formula: https://youtu.be/cJVj5nhkKBw

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
Anonymous
Not applicable

works like a charm! thank you @amitchandak

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.