Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us at FabCon Vienna from September 15-18, 2025, for the ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM. Get registered
Hi!
I'm trying to create an If condition in a pipeline that should be true if a table in my DW has more than 0 rows.
I don't know how to query this table from the IF Condition.
I tried to use a lookup before to query the table (count(*) as nr_of_rows from ...) but then I don't know how to access the value nr_of_rows when writing the expression in the if statement. I tried some different variations but nothing seems to work.
The condition in my if is of the form:
Solved! Go to Solution.
Yes that was it. I removed the quotes from the 0 and not it works as expected:
Hi!
Thanks for the suggestion. My setup was close to what you describe, but now I think it is the same:
Lookup:
IF:
Are we sure that we are accessing the number from the lookup and no other part of the string or something, which would make the output not exactly equal to 0?
Hi @JE_test ,
As part of debugging, can you please use a Set Variable and try to see the output of it?
When I tried to repro, it is working perfectly. I can go to true and false branches.
Thanks for the tips with using Set Variable for debugging!
Maybe the problem was that it was comparing an integer to a string and found it to be false. When I try to assign the output to a String I get this error:
The variable 'output' of type 'String' cannot be initialized or updated with value of type 'Integer'. The variable 'output' only supports values of types 'String'.
Yes that was it. I removed the quotes from the 0 and not it works as expected:
Hi @JE_test ,
It was great to know that you were able to get to a resolution . We expect you to keep using this forum and also motivate others to do that same . You can always help other community members by answering to their queries
Hi @JE_test ,
Thanks for using Fabric Community.
As I understand you would like to perform if else operation based on value of count.
Steps to achieve it -
select count(*) as count from api.table4
@not(equals(activity('Lookup1').output.firstRow.count, '0'))
FYI: inorder to understand the loopup activity json output,
After execution of pipeline, you find the below -
Hope this is helpful. Please let me know incase of further queries.
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 Fabric update to learn about new features.
User | Count |
---|---|
2 | |
2 | |
2 | |
2 | |
2 |