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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
youngmoneyduke
Frequent Visitor

Divide each value in a column by a value in that column that match the smallest index value

Hi guys,


I have been really struggling with this simple looking task. Here what I want to do is create a ratio column that equal each value in the Equity column divided by the equity value that associate with the SMALLEST value in Index column.
In other word, I want to create a (Ratio) column that equal values in the Equity column divided by the first row value of the Equity column.

 

For example my data set right now: (note that M Equity and M Equity ratio are custom Measures)

youngmoneyduke_1-1612804564976.png

 

My desire outcome should be:

IndexM EquityM Equity Ratio
40

754665

1.0000
417417420.9829
427343400.9731
437527450.9975
447142970.9465
457235760.9588

 

I should also note that this data table above can be filter by some date slicer, so the index value might change.
Thank you so much in advance.

 

 

2 ACCEPTED SOLUTIONS
v-janeyg-msft
Community Support
Community Support

Hi, @youngmoneyduke 

 

According to your description, I think you can create a measure to calculate the desired result.

Like this:

 

M Equity Ratio =
VAR a =
    CALCULATE ( MIN ( 'Table 2'[Index] ), ALLSELECTED ( 'Table 2' ) )
VAR b =
    CALCULATE ( [M Equity], 'Table 2'[Index] = a )
RETURN
    DIVIDE ( [M Equity], b )

 

1.png

If it doesn’t solve your problem, please feel free to ask me.

 

Best Regards

Janey Guo

 

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

Thank you so much Janey, your DAX code solve the problem that has been on my plate for a long time! Your code almost provide me the perfect answer. I would add another ALLSELECTED to var b in your formular for the complete answer as follow, which work perfect for me:

 
M Equity Ratio2 =
VAR a =
CALCULATE ( MIN ( 'HA SEPA FULL'[Index.1] ), ALLSELECTED ( 'HA SEPA FULL' ) )
VAR b =
CALCULATE ( [M Equity], 'HA SEPA FULL'[Index.1] = a, ALLSELECTED ( 'HA SEPA FULL' ) )
RETURN
DIVIDE ( [M Equity], b )

View solution in original post

4 REPLIES 4
v-janeyg-msft
Community Support
Community Support

Hi, @youngmoneyduke 

 

According to your description, I think you can create a measure to calculate the desired result.

Like this:

 

M Equity Ratio =
VAR a =
    CALCULATE ( MIN ( 'Table 2'[Index] ), ALLSELECTED ( 'Table 2' ) )
VAR b =
    CALCULATE ( [M Equity], 'Table 2'[Index] = a )
RETURN
    DIVIDE ( [M Equity], b )

 

1.png

If it doesn’t solve your problem, please feel free to ask me.

 

Best Regards

Janey Guo

 

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

Thank you so much Janey, your DAX code solve the problem that has been on my plate for a long time! Your code almost provide me the perfect answer. I would add another ALLSELECTED to var b in your formular for the complete answer as follow, which work perfect for me:

 
M Equity Ratio2 =
VAR a =
CALCULATE ( MIN ( 'HA SEPA FULL'[Index.1] ), ALLSELECTED ( 'HA SEPA FULL' ) )
VAR b =
CALCULATE ( [M Equity], 'HA SEPA FULL'[Index.1] = a, ALLSELECTED ( 'HA SEPA FULL' ) )
RETURN
DIVIDE ( [M Equity], b )
parry2k
Super User
Super User

@youngmoneyduke index is a measure or a column?

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hi @parry2k

The index column is a column not a measure. It is originally not in my csv file, but I use Power Query to add that column to the table. 
Thanks in advance!

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.