Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi all,
On the Excel I have 2 Worksheets.
Table 1
If Table1[Var] match the Table2[Min] then give me the Percentage
Is it possible to elimnate index/lookup table and use the Switch function? If yes, How do I turn this Index function into a Switch Function?
=INDEX(Table2[Percentage],MATCH([@Var],Table2[Min],1))
Lookup Table (Table2)
Thanks you 🙂
Solved! Go to Solution.
Hi @Stuznet,
Here we can use the IF function to create a calculated column to work on it.
Column = IF ( Table1[var] > -1000 && Table1[var] < -0.25, "<(25%)", IF ( Table1[var] > -0.25 && Table1[var] < -0.1, "(25%) - (10%)", IF ( Table1[var] > -0.1 && Table1[var] < -0.03, "(10%)-(3%)", IF ( Table1[var] > -0.03 && Table1[var] < 0.03, "(3%)-3%", IF ( Table1[var] > 0.03 && Table1[var] < 0.1, "3%-10%", IF ( Table1[var] > 0.1 && Table1[var] < 0.25, "10%-25%", IF ( Table1[var] > 0.25, ">25%" ) ) ) ) ) ) )
For more details, please check the pbix as attached.
Regards,
Frank
This formula will achieve the same desired result 🙂
Column 2 = MINX ( TOPN ( 1, FILTER ( Table2, Table1[var] > Table2[Min] ), [Min], DESC ), [Percentage] )
Hi @Stuznet,
Here we can use the IF function to create a calculated column to work on it.
Column = IF ( Table1[var] > -1000 && Table1[var] < -0.25, "<(25%)", IF ( Table1[var] > -0.25 && Table1[var] < -0.1, "(25%) - (10%)", IF ( Table1[var] > -0.1 && Table1[var] < -0.03, "(10%)-(3%)", IF ( Table1[var] > -0.03 && Table1[var] < 0.03, "(3%)-3%", IF ( Table1[var] > 0.03 && Table1[var] < 0.1, "3%-10%", IF ( Table1[var] > 0.1 && Table1[var] < 0.25, "10%-25%", IF ( Table1[var] > 0.25, ">25%" ) ) ) ) ) ) )
For more details, please check the pbix as attached.
Regards,
Frank
This formula will achieve the same desired result 🙂
Column 2 = MINX ( TOPN ( 1, FILTER ( Table2, Table1[var] > Table2[Min] ), [Min], DESC ), [Percentage] )
@Zubair_Muhammad, @v-frfei-msft. Thank you so much, I accepted both solutions. It Worked!! 🙂
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
94 | |
82 | |
66 | |
58 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |