This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
Hi,
I have a table visual where each columns have some data and I have created measures to give me the output for each of these columns as 1 and 0 based on each columns criteria.
so for example I have 10 columns , I created 10 measures , each measures has a criteria formula for each of these columns which returns 1's and 0'. below is the 1 measure.
i created other 10 measures to count the occurence of 1's. something like this
Solved! Go to Solution.
So the problem with measures that use patterns like IF( <condition>, 1, 0 ) is that they effectively generate a lot of data that does not exist in your data source. If you have sales data and you table a table with Customer, Product and Date you are forcing the engine to calculate a value for every product for every customer on every day.
Since you are only interested in the 1's changing this to IF( <condition>, 1, BLANK() ) should dramatically increase your performance as the tabular engine is very good at skipping blanks.
But possibly an even faster approach is to just do a countrows of your filter condition which will avoid the IF logic entirely
So you cannot divide the FILTER() function (which returns a table with multiple rows and columns) by a count rows. You should not need to change the [% of width] measure at all - the old measure that references [Value of Highlight W] should still work.
Or you could simplify it and reduce it down to the following (note I recommend getting in the habit of using the DIVIDE() function instead of the numeric / operator as it safely handles divide by 0 or divide by blank)
% of width = DIVIDE( [Value of Highlight W] , Countrows( All(zcvrMaterial) ) )
So the problem with measures that use patterns like IF( <condition>, 1, 0 ) is that they effectively generate a lot of data that does not exist in your data source. If you have sales data and you table a table with Customer, Product and Date you are forcing the engine to calculate a value for every product for every customer on every day.
Since you are only interested in the 1's changing this to IF( <condition>, 1, BLANK() ) should dramatically increase your performance as the tabular engine is very good at skipping blanks.
But possibly an even faster approach is to just do a countrows of your filter condition which will avoid the IF logic entirely
Thanks @d_gosbell ,
It now works a little faster compare to previous.
However, I also have a measure which calculates the % of occurence of 1's
I have used this measure base on my previous measure.
So you cannot divide the FILTER() function (which returns a table with multiple rows and columns) by a count rows. You should not need to change the [% of width] measure at all - the old measure that references [Value of Highlight W] should still work.
Or you could simplify it and reduce it down to the following (note I recommend getting in the habit of using the DIVIDE() function instead of the numeric / operator as it safely handles divide by 0 or divide by blank)
% of width = DIVIDE( [Value of Highlight W] , Countrows( All(zcvrMaterial) ) )
Thanks @d_gosbell ,
This has now solved my problem.
I did get the infinite output as my value was getting divide by blank.
I have now used the divide function.
Thanks for all your help!
-Tejaswi
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 25 | |
| 22 | |
| 21 | |
| 19 | |
| 18 |
| User | Count |
|---|---|
| 42 | |
| 41 | |
| 40 | |
| 21 | |
| 20 |