cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

How to find the good value from 3 columns into the same table

Hello,

 

Imagine that I have the following values into a table.

Now if we take the first row in column F, the value is 4.5% then if we go in column c is less than 5.6% then F take the value of Column A, which is 2.8.  For the second value into E, the value is 9.1.  9.1 is less than 11.1 (column c) so we take the value of Column A (previous row) which is 2.8%.  The for the third value in E, which is 13.6%, this value is less than 16.7% in Column C, so we take the row before and the value in A is 2.8 .  For the fourth value in column E which is 18.2%, this value is less than 22.2% in column C, then we take the value in column A (previous row) which is 1.5%.

So what's the best way to get the value of column F using those in column E, C and A?

 

ABCDEF
    4.5%2.8%
    9.1%2.8%
    13.6%2.8%
    18.2%1.5%
2.8%1.005.6% 22.7%1.5%
2.8%2.0011.1% 27.3%1.5%
1.5%3.0016.7% 31.8%1.5%
1.5%4.0022.2% 36.4%1.5%
1.5%5.0027.8% 40.9%1.5%
1.5%6.0033.3% 45.5%0.8%
1.5%7.0038.9% 50.0%0.8%
0.8%8.0044.4% 54.5%0.8%
0.8%9.0050.0% 59.1%0.8%
0.8%10.0055.6% 63.6%0.8%
0.8%11.0061.1% 68.2%0.8%
0.8%12.0066.7% 72.7%0.2%
0.2%13.0072.2% 77.3%0.2%
0.2%14.0077.8% 81.8%0.2%
0.2%15.0083.3% 86.4%0.2%
0.2%16.0088.9% 90.9%0.2%
0.2%17.0094.4% 95.5%0.2%
0.2%18.00100.0% 100.0%0.2%
1 ACCEPTED SOLUTION

@Anonymous 

please try this

Column = 
VAR num=MINX(FILTER('table','table'[C]>=EARLIER('table'[E])),'table'[B])
VAR result=maxx(FILTER('table','table'[B]=num-1),'table'[A])
VAR result2=maxx(FILTER('table','table'[B]=num),'table'[A])
return if(ISBLANK(result),result2,result)

1.PNG





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

Proud to be a Super User!




View solution in original post

6 REPLIES 6
Super User II
Super User II

@Anonymous 

Just want to make sure if  there are  any empty cells on the top of column A,B,C,D?





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

Proud to be a Super User!




Anonymous
Not applicable

Yes, there is empty cells on the top of A, B,C, D.  Also, I don't see you solution.  Did you forgot to add it

Regards,

@Anonymous 

still trying to be clear about your calculation logic. what if column E is bigger than or equals to column C?





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

Proud to be a Super User!




Anonymous
Not applicable

Okay. If we look at values found in column E.  Choose one randomly.  Let's say 40.9%.  If we consider only this value and look at those found in column C, we can say that 40.9% is bigger than 38.9% but less than 44.4%.  So from that, we can say that the value in column A is 1.5% for 38.9% but 0.8% for 44.4%.  So the value we are looking for in column A is 1.5%.  So we will take this value and bring it to column F while the value in column E is 40.9%.

 

We repeat the same process for each value in column E and get the values for column F than we repeat those steps for each projectskey. 

@Anonymous 

please try this

Column = 
VAR num=MINX(FILTER('table','table'[C]>=EARLIER('table'[E])),'table'[B])
VAR result=maxx(FILTER('table','table'[B]=num-1),'table'[A])
VAR result2=maxx(FILTER('table','table'[B]=num),'table'[A])
return if(ISBLANK(result),result2,result)

1.PNG





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

Proud to be a Super User!




View solution in original post

Anonymous
Not applicable

Thank you so much for your help.

Helpful resources

Announcements
secondImage

Experience what’s next for Power BI

Join us for an in-depth look at the new Power BI features and capabilities at the free Microsoft Business Applications Launch Event.

secondImage

Power BI Women

Join our monthly meetings and learning sessions.

secondImage

Congratulations!

We are excited to announce the Power BI Super Users!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors