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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Fabcon_Europe_Social_Bogo

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.