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, I would like to create variables from a table which relate to the row number and a specific column.
There are two columns WL and ST. Each variable will be numbered in relation to Row No. As shown below, for example:-
For Row 1 the two variables will be WL1 and ST1. Where WL1 = 21 and ST1 = 1680
For Row 2 the two variables will be WL2 and ST2. Where WL2 = 156 and ST2 = 1680
and so on up to a maximum of 30 rows.
I will then use the variables in different formulas such as
Formula 1 = WL1 + ST1
Formula 2 = Formula 1 + WL1 - ST1
Is it possible to extract a figure in a column and relate to row no. such as WL1 = 21 or ST1 = 1680?
I hope this makes sense. Any question let me know.
Thank you for any help in advance.
PBE
Solved! Go to Solution.
Hi, @PBE
You can try the following methods.
New table:
New table = ADDCOLUMNS('Table',"WL Variable","WL"&[Row No.],"ST Variable","ST"&[Row No.])
Column:
Formula 1 = IF([WL Variable]="WL1"&&[ST Variable]="ST1",[ST]+[WL])
Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @PBE
You can try the following methods.
New table:
New table = ADDCOLUMNS('Table',"WL Variable","WL"&[Row No.],"ST Variable","ST"&[Row No.])
Column:
Formula 1 = IF([WL Variable]="WL1"&&[ST Variable]="ST1",[ST]+[WL])
Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you that worked
Hi @v-zhangti
Thanks for this, it looks good. I'll try it out and let you know how I get on.
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
72 | |
70 | |
37 | |
29 | |
27 |
User | Count |
---|---|
91 | |
49 | |
45 | |
38 | |
36 |