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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

One "What if" parameter for each row in a column with cumulative sum

Is it possible to change each row of a column with "what if" parameter(Column C)?
I would like to have something like the picture below. My wished result for row 0 column C in this example would be 3535. And I would like to have one "what if" slider for each row.

 

I would also like to have a cumulative sum of every row. So if C[0] is 3535 in this case and the slider for C[1] is 0 I would like to have the result 6035 at C[1] and so on.

Skärmklipp1.JPG

Thanks in advance!

1 ACCEPTED SOLUTION
v-xiaoyan-msft
Community Support
Community Support

Hi,@Anonymous 

 

First,you can create an index table.

then create a measure like this to meet your needs:

 

Measure = 
SWITCH(SELECTEDVALUE('Table'[Index]),
1,
CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),'Table'[Date]<=MAX('Table'[Date])))+'Parameter'[Parameter Value],
2,
CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),'Table'[Date]<=MAX('Table'[Date])))+'Parameter'[Parameter Value]+'Parameter1'[Parameter1 Value],
3,
CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),'Table'[Date]<=MAX('Table'[Date])))+'Parameter'[Parameter Value]+'Parameter1'[Parameter1 Value]+'Parameter2'[Parameter2 Value],
4,
CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),'Table'[Date]<=MAX('Table'[Date])))+'Parameter'[Parameter Value]+'Parameter1'[Parameter1 Value]+'Parameter2'[Parameter2 Value]+'Parameter3'[Parameter3 Value])

 

 

 

New Price = SUMX(VALUES('Table'[Date]),'Table'[Measure])

 

 

0113.png

 

Here is the demo , please try it: https://qiuyunus-my.sharepoint.com/:u:/g/personal/admin_qiuyunus_onmicrosoft_com/EXZRdw5LGR5Jpjn079Q9G9wB9CJV-3BMb6zS1baD19zeiw?e=EnLd46

 

Hope it helps.

 

Best Regards,

Caitlyn Yan

 

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-xiaoyan-msft
Community Support
Community Support

Hi,@Anonymous 

 

First,you can create an index table.

then create a measure like this to meet your needs:

 

Measure = 
SWITCH(SELECTEDVALUE('Table'[Index]),
1,
CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),'Table'[Date]<=MAX('Table'[Date])))+'Parameter'[Parameter Value],
2,
CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),'Table'[Date]<=MAX('Table'[Date])))+'Parameter'[Parameter Value]+'Parameter1'[Parameter1 Value],
3,
CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),'Table'[Date]<=MAX('Table'[Date])))+'Parameter'[Parameter Value]+'Parameter1'[Parameter1 Value]+'Parameter2'[Parameter2 Value],
4,
CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),'Table'[Date]<=MAX('Table'[Date])))+'Parameter'[Parameter Value]+'Parameter1'[Parameter1 Value]+'Parameter2'[Parameter2 Value]+'Parameter3'[Parameter3 Value])

 

 

 

New Price = SUMX(VALUES('Table'[Date]),'Table'[Measure])

 

 

0113.png

 

Here is the demo , please try it: https://qiuyunus-my.sharepoint.com/:u:/g/personal/admin_qiuyunus_onmicrosoft_com/EXZRdw5LGR5Jpjn079Q9G9wB9CJV-3BMb6zS1baD19zeiw?e=EnLd46

 

Hope it helps.

 

Best Regards,

Caitlyn Yan

 

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Thank you for answering @amitchandak, but I can't get your measure to work.

I've tried this based on the  first picture below:

 

Measure = CALCULATE( SUM ('Table'[Price]) , FILTER( 'Table', [Date] = TODAY() )) + Parameter[Parameter Value]

 

Column "New price(Measure)" is my wished result, but column  "Measure" is what I get. And since I am not allowed to put the Parameter value inside CALCULATE it adds this values to every row.

 

My wished result = Measured value on the row above + Table[Price] on row + Parameter value to this raw (There is one parameter value for each row) 

 
 
Skärmklipp6.JPG
 
I can do the Table like this picture below if it makes it easier to solve my problem?
 
Skärmklipp5.JPG
 
 
amitchandak
Super User
Super User

@Anonymous , based on what I got

Try a measure like

Measure = calculate(sum(Table[B]), filter(Allselected(Table), Table[A] <= Max(Table[A]))) + selectedvalue(Whatif[Parameter])

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.