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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
JohannSteyn
Frequent Visitor

Filter relative to current row

Hi all,
I need some help please. I think have this basic issue embedded in a more complex forumla.

 

I have the following columns: Date 1, Date 2, Amount.
I want to add a column with the sum of the amount when any Date 2 is larger (or equal) to the specific row's Date 1.

This is what I want (excel representation):

JohannSteyn_0-1639482081018.png

 

Please help with suggestions that I can use in DAX to add a column with the above result.

 

Thanks in advance

 

1 ACCEPTED SOLUTION

@JohannSteyn , Sorry, I think I reverted the logic

 

new column =
var _date = [Date1]
return
sumx(filter(Table, Table[Date2] >=_Date),[Amount])

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@JohannSteyn , Try a new column like

 

new column =
var _date = [Date2]
return
sumx(filter(Table, Table[Date1] <=_Date),[Amount])

@amitchandak  Thanks for the suggestion. Unfortuntely that does not work (see below). Any other ideas?

JohannSteyn_0-1639484446744.png

 

@JohannSteyn , Sorry, I think I reverted the logic

 

new column =
var _date = [Date1]
return
sumx(filter(Table, Table[Date2] >=_Date),[Amount])

@amitchandak working! You're awesome! Thank you

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.