Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Good morning,
I want to generate a loop like this with the following information:
list=[]
i=1
while i<5:
if #pallets[i]<#huecos[i]:
list=list+LETRA[i]
i=i+1
return list
Solved! Go to Solution.
Hi, @XaviOV
According to your follow-up, I can understand your logic now, I think you can achieve this using the calculated table in Power BI, you can try my step:
Go to the table tool, create a new table like this:
List =
SELECTCOLUMNS(
FILTER(ALL('Table'),[#pallets]<[#huecos]),
"LETRA",[LETRA])
Then you can get the expected list:
The list will also be updated with the change of the dataset.
You can download my test pbix file here
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @XaviOV
According to your IF formula, I can’t clearly understand what you want to get. I’m wondering what does “LETRA[i]” mean? Because the column [LETRA] is “Text” type and it can’t be used to calculate with a number. Would you like to add a column to display your expected result manually?
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @XaviOV
According to your follow-up, I can understand your logic now, I think you can achieve this using the calculated table in Power BI, you can try my step:
Go to the table tool, create a new table like this:
List =
SELECTCOLUMNS(
FILTER(ALL('Table'),[#pallets]<[#huecos]),
"LETRA",[LETRA])
Then you can get the expected list:
The list will also be updated with the change of the dataset.
You can download my test pbix file here
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@XaviOV , Still not clear. You create first column using generateseries , rest need to come from that
generateseries(1,5)
https://docs.microsoft.com/en-us/dax/generateseries-function
Hi, @amitchandak
I want transalate this formula to DAX
list=[]
i=1
while i<5:
if #pallets[i]<#huecos[i]:
list=list+LETRA[i]
i=i+1
return list
Regards,
Xavi
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
76 | |
76 | |
56 | |
38 | |
34 |
User | Count |
---|---|
99 | |
56 | |
51 | |
44 | |
40 |