Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
dtd_89
Frequent Visitor

Correct Total using ALL() whilst also having blanks filtered out of visual?

Hi

 

I'm hoping someone may have a quick solution to a problem i'm encountering whilst trying to provide % of total in a bar chart.

 

The screenshot below shows a dummy dataset for customer feedback replicating the issue i'm encountering. The data spans over 3 days (20th Oct to 22 Oct), with a total of 25 customers, 9 of which opted not to give feedback.

 

I'm needing to present this data as a % broken out by feedback score. I have used the 'feedback%' measure shown below, which leverages the ALL() function to clear the feedback_rating filter, providing a total customer count. You can see from the 2nd bar chart that this works when the blank feedback rating option is included in the visual. Example feedback score of 1 has 5 customer entries, 5/25 = 20%.

 

I have been asked to remove blanks from the visual. When these are removed however, the % are incorrect as can be seen within the red bar chart, a feedback score of 1 now has a % distribution of 26%.

 

The reason appears to be due to the Date slicer which is required in my real dashboard. As all the customers on 21st October did not leave feedback, I believe when the blanks are removed from the visual, all of these rows are removed from the underlying data, creating a new customer total of 19, resulting in incorrect %'s, feedback score of 1 now becoming 26% (5/19) as mentioned above.

 

Any ideas on how to keep these values in the total whilst also keeping the blank entries out of the visual? Ideally I would like to solve it within a DAX measure as my existing dashboard already has a relatively complex data model, however I appreciate it may require a helper table of some sort.

 

feedback% =
distinctcount(Sheet1[customer_id]) /
CALCULATE(DISTINCTCOUNT(Sheet1[customer_id]),ALL(Sheet1[feedback_rating]))

 

dtd_89_0-1699015775659.png

Thanks for reading. 

9 REPLIES 9
Dangar332
Super User
Super User

Hi, @dtd_89 

check your feedback_rating column data type 
change it to whole number

 

 

Hi, it's already set as a whole number, thanks

Hi, @dtd_89 

 

check below image

Dangar332_0-1699034562893.png

 

Thanks for the screenshot, in your underling dummy data, do you have a day were no customers left feedback, i.e. the feedback column is blank?

 

When there is a day with no feedback scores, when blanks are omitted from the visual, these customers are also lost from the overall count, even though ALL([Feedback_rating]) is being used.

 

I guess it is to do with the ordering of filtering by BI, however I'm yet to figure out a way around it other than using seperate aggreagated tables which in big datasets becomes complex.

 

Thanks

Hi, @dtd_89 

 

i am not able to find file that i am attached screenshot above.

 

but there nothing to do i just drag and drop your column in visuals it automatically omitted blank value and give output like above.

 

i think try to update your version i am use (sep-23).

it done auto as a show up above.

 

sjoerdvn
Super User
Super User

try adding an "IF", so the measure returns blank when the feedback rating is blank.

feedback% = IF(CALCULATE(DISTINCTCOUNT(Sheet1[feedback_rating]),Sheet1[feedback_rating])>0,
distinctcount(Sheet1[customer_id]) /
CALCULATE(DISTINCTCOUNT(Sheet1[customer_id]),ALL(Sheet1[feedback_rating]))
)

 

No joy unfortunately, adding in the IF statement produces the same results as the red bar chart I included in my screenshot. Thanks 

ValtteriN
Super User
Super User

Hi,

I tried to recreate this issue with mock data, but couldn't. I recommend you create a test measure to check the denominator value e.g. 

Measure 8 = CALCULATE(DISTINCTCOUNT('Table (12)'[Customer]),ALL('Table (12)'[Answer]))

If the result is 25 like here the issue is else where:

ValtteriN_0-1699022538784.png

 

I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Thanks for having a look and the advice.

 

I'm unable to see all of your data, so can't determine the expected results of the calc. Do you have any dates in your dummy data where no customers have provided feedback? This is what is causing the incorrect Denominator within my data, i.e. the count for these days is being removed from the total.

 

Thanks

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.