Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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!! 🙂
User | Count |
---|---|
77 | |
76 | |
43 | |
30 | |
26 |
User | Count |
---|---|
97 | |
91 | |
52 | |
47 | |
46 |