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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
gauravnarchal
Post Prodigy
Post Prodigy

If Invoice Date is less than selected date

I need help to create a measure!

 

If Invoice date is less than (Selected date) return total Invoice amount.

 

invoice dateNameCompanyInvoiceAmount
20-Jul-20User1ABC200
25-Jul-20User2ABC500
30-Jul-20User3ABC800
04-Aug-20User4ABC1100
09-Aug-20User5ABC1400
10-Jun-20User1ABC1231700
20-Jun-20User2ABC1232000
30-Jun-20User3ABC1232300
10-Jul-20User4ABC1232600
20-Jul-20User5ABC1232900
30-Jul-20User6ABC1233200
09-Aug-20User7ABC1233500
19-Aug-20User8ABC1233800
10-Jun-20User1TEST14100
20-Jun-20User2TEST14400
30-Jun-20User3TEST14700
10-Jul-20User4TEST15000
20-Jul-20User5TEST15300
30-Jul-20User6TEST15600
09-Aug-20User7TEST15900
19-Aug-20User8TEST16200
29-Aug-20User9TEST16500
08-Sep-20User10TEST16800
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@gauravnarchal ,

if date table is connected

new measure =
var _date = maxx(allselected(Date),Date[date])
return
calculate(Sum(Table[duration_alarms_7day]), filter(All(Table), Table[invoice date] < _date ))

 

if date table is not connected
new measure =
var _date = maxx(allselected(Date),Date[date])
return
calculate(Sum(Table[duration_alarms_7day]), filter(Table Table[invoice date] < _date ))

View solution in original post

4 REPLIES 4
Pragati11
Super User
Super User

HI @gauravnarchal ,

 

How you want this Selected Date value on yuor report? Will it come from a filter?

You haven't detailed your query enough.

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Hi @Pragati11  -  Selected date is measure. "SelectedDate = MIN('Calendar'[Date])"

 
I will use the Calendar Date in the slicer to get my results.
amitchandak
Super User
Super User

@gauravnarchal ,

if date table is connected

new measure =
var _date = maxx(allselected(Date),Date[date])
return
calculate(Sum(Table[duration_alarms_7day]), filter(All(Table), Table[invoice date] < _date ))

 

if date table is not connected
new measure =
var _date = maxx(allselected(Date),Date[date])
return
calculate(Sum(Table[duration_alarms_7day]), filter(Table Table[invoice date] < _date ))

Thanks @amitchandak  I have used the below measure and it worked.

 

if date table is not connected
new measure =
var _date = maxx(allselected(Date),Date[date])
return
calculate(Sum(Table[duration_alarms_7day]), filter(Table Table[invoice date] < _date ))

 

Can you please help me to create a measure to get the result for the below:-

 

If Invoice date is Greater than (Selected date) return total Invoice amount.

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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