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.
I'm trying to create a measure where I can reference a pre-filtered value. It will end up being a %, but for simplicity:
Measure = CALCULATE(DISTINCTCOUNT('TABLE'[Value]),FILTER('TABLE','TABLE'[VALUE] (is not blank)
I just need a count of the value when it is not blank/without nulls. I've tried:
TABLE [VALUE] =ISBLANK(FALSE), =ISEMPTY(FALSE), = <> BLANK(), etc.
You guys have been a great help before. Help me again? Thanks
Solved! Go to Solution.
Measure = DIVIDE ( CALCULATE ( DISTINCTCOUNT ( 'TABLE'[Value] ), FILTER ( 'TABLE', 'TABLE'[VALUE] <> BLANK () ) ), DISTINCTCOUNT ( 'TABLE'[VALUE] ), 0 )
How about this...
Measure = CALCULATE ( DISTINCTCOUNT ( 'TABLE'[Value] ), FILTER ( 'TABLE', 'TABLE'[VALUE] <> BLANK () ) )
That gives the correct value. When I try to make it a %, however,
Measure =
CALCULATE (DISTINCTCOUNT ( 'TABLE'[Value] ), FILTER ( 'TABLE', 'TABLE'[VALUE] <> BLANK () ) )
/ DISTINCTCOUNT('TABLE'[VALUE])),
(i.e. dividing the filtered value by its unfiltered self), it gives me
"A function FILTER has been used in a True/False expression that is used as a table filter expression. This is not allowed."
Measure = DIVIDE ( CALCULATE ( DISTINCTCOUNT ( 'TABLE'[Value] ), FILTER ( 'TABLE', 'TABLE'[VALUE] <> BLANK () ) ), DISTINCTCOUNT ( 'TABLE'[VALUE] ), 0 )
Hello,
I have a little question: why is the Filter function applied while the Calculate function itself has a filter?
That did it. Thanks for making the formatting clear - it was easy to follow the logic.
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 |
---|---|
70 | |
67 | |
51 | |
39 | |
26 |
User | Count |
---|---|
87 | |
55 | |
45 | |
42 | |
36 |