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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
CSmith_HW
Frequent Visitor

DAX Help! Return date that cumulative total surpassed a column value

Hi guys,

 

I have a campaign table that look like the below:

 

Campaign IDTarget Price
1£50,000
2£70,000
3£120,000
4£35,000

 

and a table of deals that looks like:

Deal IDCampaign IDPriceDate
11£5,00008/02/2021
22£7,00024/12/2020
32£11,00012/01/2021
43£13,50030/10/2020
51£3,50001/02/2021

 

The 2 tables are joined in a 1-to-many via campaign ID. Now, what I would like to do, preferably in a calculated column on the campaign table is return the date at which the cumulative sum of "Price" surpassed the Target Price.

So the logic would look something like this:

  1. Use the date on the deal table to create a cumulative running total of all deals for each campaign.

  2. Monitor when the cumulative running total surpasses the target price

  3. Return the date that final deal happened to take us over the target price

 

Any help would be great,

Thanks

1 ACCEPTED SOLUTION
rfigtree
Resolver III
Resolver III

hi i have a problem understanding context transition but i think this works.

probably a much neater way of doing it.

had to fiddle your data as none of the targets met as you put them.

 

rfigtree_0-1613135259887.pngrfigtree_1-1613135286220.png

 

View solution in original post

2 REPLIES 2
rfigtree
Resolver III
Resolver III

hi i have a problem understanding context transition but i think this works.

probably a much neater way of doing it.

had to fiddle your data as none of the targets met as you put them.

 

rfigtree_0-1613135259887.pngrfigtree_1-1613135286220.png

 

Yep I used dummy data in my example - it works though thanks!

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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