Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Microsoft Power BI Community
- Forums
- Get Help with Power BI
- Desktop
- How to find the good value from 3 columns into the...

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

Anonymous

Not applicable

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

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

07-13-2020
01:39 PM

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?

A | B | C | D | E | F |

4.5% | 2.8% | ||||

9.1% | 2.8% | ||||

13.6% | 2.8% | ||||

18.2% | 1.5% | ||||

2.8% | 1.00 | 5.6% | 22.7% | 1.5% | |

2.8% | 2.00 | 11.1% | 27.3% | 1.5% | |

1.5% | 3.00 | 16.7% | 31.8% | 1.5% | |

1.5% | 4.00 | 22.2% | 36.4% | 1.5% | |

1.5% | 5.00 | 27.8% | 40.9% | 1.5% | |

1.5% | 6.00 | 33.3% | 45.5% | 0.8% | |

1.5% | 7.00 | 38.9% | 50.0% | 0.8% | |

0.8% | 8.00 | 44.4% | 54.5% | 0.8% | |

0.8% | 9.00 | 50.0% | 59.1% | 0.8% | |

0.8% | 10.00 | 55.6% | 63.6% | 0.8% | |

0.8% | 11.00 | 61.1% | 68.2% | 0.8% | |

0.8% | 12.00 | 66.7% | 72.7% | 0.2% | |

0.2% | 13.00 | 72.2% | 77.3% | 0.2% | |

0.2% | 14.00 | 77.8% | 81.8% | 0.2% | |

0.2% | 15.00 | 83.3% | 86.4% | 0.2% | |

0.2% | 16.00 | 88.9% | 90.9% | 0.2% | |

0.2% | 17.00 | 94.4% | 95.5% | 0.2% | |

0.2% | 18.00 | 100.0% | 100.0% | 0.2% |

Solved! Go to Solution.

1 ACCEPTED SOLUTION

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

07-13-2020
08:06 PM

@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)
```

Proud to be a Super User!

6 REPLIES 6

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

07-13-2020
06:16 PM

@Anonymous

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

Proud to be a Super User!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

07-13-2020
06:25 PM

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,

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

07-13-2020
06:44 PM

@Anonymous

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

Proud to be a Super User!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

07-13-2020
07:10 PM

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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

07-13-2020
08:06 PM

@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)
```

Proud to be a Super User!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

07-14-2020
07:27 AM

Thank you so much for your help.

Announcements

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

Featured Topics

Top Solution Authors

User | Count |
---|---|

420 | |

149 | |

112 | |

50 | |

50 |

Top Kudoed Authors

User | Count |
---|---|

458 | |

141 | |

131 | |

82 | |

71 |