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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
bubbledep
Frequent Visitor

How to make a cumulative filldown with two different measures?

Hi everyone,

 

I need some help to build a logic that sum the first data from "_MG_price" column (01/04/2023) with the non-blank values from the "_price" column and filldown those values.

bubbledep_0-1724181522098.png

The expected result would something like this:

01/04 - 5,2141

02/04 - 5,2141

03/04 - 5,2141+(-0,0373) = 5,1768
04/04 - 5,1768
05/04 - 5,1768
06/04 - 5,1768
07/04 - 5,1768
08/04 - 5,1768
09/04 - 5,1768
10/04 - 5,1768+(-0,0185) = 5,1583
11/04 - 5,1583
.

.

.

 

I tried already some builds, but none of them worked so far (both columns in that table are measures). Thank you to all in advance.

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@bubbledep 

pls see if this is what you want

 

Measure =
VAR _start=CALCULATE(min('Table'[Date]),ALL('Table'))
var _mg=CALCULATE([mg],FILTER(all('Table'),'Table'[Date]=_start))
var _price=sumx(FILTER(all('Table'),'Table'[Date]<=max('Table'[Date])),'Table'[_price])
return _mg+_price
 
11.png
 
pls see the attachment below




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

4 REPLIES 4
lbendlin
Super User
Super User

Looks like a standard running total calculation where you add _price and _MG_price of all prior dates and the current date. 

ryan_mayu
Super User
Super User

@bubbledep 

pls see if this is what you want

 

Measure =
VAR _start=CALCULATE(min('Table'[Date]),ALL('Table'))
var _mg=CALCULATE([mg],FILTER(all('Table'),'Table'[Date]=_start))
var _price=sumx(FILTER(all('Table'),'Table'[Date]<=max('Table'[Date])),'Table'[_price])
return _mg+_price
 
11.png
 
pls see the attachment below




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Hi @ryan_mayu , thanks for your help, that's exactly what I needed! I just adapted those ALL functions to ALLSELECT since my table is filtered, but it worked just fine.

 

Seems thats I was trying to do so much for a simple thing haha, thanks!

 

Cheers

you are welcome





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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