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
aman749
Frequent Visitor

MEASURE: GET SUM FROM THE BOTTOM OF A TABLE UNTIL CONDITION IS REACHED

THERE IS A FILTERED TABLE AS FOLLOWING IN A VISUAL.

WHAT I NEED IS A MEASURE THAT GIVES SUM(QUANTITY*PRICE), STARTING FROM THE BOTTOM UNTIL QAUNTITY HAS REACHED TOTAL-QUANITY (175 IN THIS CASE).

SO IN THIS EXAMPLE THE MEASURE WILL BE LIKE THIS (20*232.50+10*217.60+50*216.50+95*216)=38171.  

aman749_0-1623124453324.png 

ANY HELP FOR THIS MEASURE WILL BE MUCH APPRECIATED.

1 ACCEPTED SOLUTION

Hi, @aman749 

I am not 100% sure whether I understood your explanation correctly, but please check the link down below. All measures are in the sample pbix file.

 

https://www.dropbox.com/s/ig8zmvvej43ft3q/TEST%20DATA%20%281%29.pbix?dl=0 

 

 

Hi, My name is Jihwan Kim.

 

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

 

Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

View solution in original post

6 REPLIES 6
Jihwan_Kim
Super User
Super User

Hi, @aman749 

Please check the below picture and the sample pbix file's link down below.

All measures are in the sample pbix file, and all steps are numbered in front of each measure.

 

Picture1.png

 

https://www.dropbox.com/s/dp8b83bqrrlsrzl/aman.pbix?dl=0 

 

 

Hi, My name is Jihwan Kim.

 

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

 

Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

Hello @Jihwan_Kim 

First of all the measure that you have provided is what I want to calculate.

But This is only somewhat in the direction of what I need.

As the data that I have constitutes multiple categorical data. and can't have a fixed index column.

Here is the file with sample data.

https://1drv.ms/u/s!AnegLsk7hHY4ja8xJR1sv78y33j3Ng?e=adbBpz

Thanks for your help again.

Best regards

Hi, @aman749 

Thank you for your feedback.

The index column that I purposely created was for identifying the sequence. 

When I saw your sample pbix file, it has the date column. I think you can use this column similar to the index column. The only thing you need to define is the below.

 

The bottom = recent date?  or,

the bottom = oldest date?

 

Thanks.

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

The bottom you can define by sorting the data by column [RateTrn] ins ascending order as already done in the pbix file. Max([RateTrn]) is bottom.

Hi, @aman749 

I am not 100% sure whether I understood your explanation correctly, but please check the link down below. All measures are in the sample pbix file.

 

https://www.dropbox.com/s/ig8zmvvej43ft3q/TEST%20DATA%20%281%29.pbix?dl=0 

 

 

Hi, My name is Jihwan Kim.

 

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

 

Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

Hello @Jihwan_Kim 

Yes, the solution that you provided works perfectly.

Although I didn't fully understand everything that you did.

Thank you very much for your help.

Best regards

 

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!

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.