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.
In a working Deneb visual that displays survey data, I have a relatively flat dataset structured this way:
When aggregating this data, I want a count of distinct values for "person" - ONLY for rows where "complete" = 0. Also, I do not want to filter the data to achieve this, because I need the filtered rows later for other purposes. My first strategy was to calculate a new column called "distinctPerson" that listed the person column value if "complete" == 1 and showed null otherwise, but the "distinct" count sees 'null' as a distinct value rather than ignoring it. Here is a link to the example in the vega editor. As you can see from the chart, "null" values - which are cases where there is no value in the person column because "complete" = 0 - are counted as distinct values:
How can I remove these null values from the count (not the chart, the actual aggregation in the background) without filtering the dataset to "datum.Completed == 1" since this would remove necessary information for later? I have tried the following concepts without success:
If I'm missing something major, please let me know - or if one of the two failed attempts I listed is likely to work, and I'm just using the wrong syntax, let me know and I can provide more info.
Thanks in advance!
UPDATE: pbix containning the visual and dataset here.
Solved! Go to Solution.
I found a simple solution. I used a "missing" op in my aggregation step to detect when null values were present in the data, and then subtracted 1 from the value of a "distinct" aggregation in a later calculate step whenever a null value was present in the series. Sample chart and dataset available at this link in the Vega editor.
Chart below:
I found a simple solution. I used a "missing" op in my aggregation step to detect when null values were present in the data, and then subtracted 1 from the value of a "distinct" aggregation in a later calculate step whenever a null value was present in the series. Sample chart and dataset available at this link in the Vega editor.
Chart below:
Can you share the sample dataset?
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.