cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
lexiko80
New Member

Percentage of total filtered count

Hello,

I am trying to show the count of specific observations as a percentage of the total observations made. My solution below works great but as soon as I add a datestamp slicer to the page, where I now want to see the percentage of specific responses made within a specific date range, the percentages no longer correspond.

This is the calculated measure:

 

 

%Observation = 
DIVIDE(
    COUNT(Sheet1[Observation]),
    CALCULATE(
        COUNT(Sheet1[Observation]),ALL(Sheet1[Observation])
    )
)

 

 

So when I place a card visual with %Observation and filter for "Too Cold" which in the sample below is 4 out of 12 observations my card shows %33.33, Great

But once I add datestamp slicer and change the date range a little, the percentages do not make sense.

lexiko80_0-1679783797268.png

 

 

Sample data:

ObservationDatestamp        Screen                                          Location
Too Cold3/1/2023Thermal ComfortA
Too Hot3/2/2023Thermal ComfortB
Too Hot3/1/2023Thermal ComfortC
Too Cold3/1/2023Thermal ComfortA
Too Cold3/20/2023Thermal ComfortA
Too Cold2/21/2023Thermal ComfortB
Comfortable2/21/2023Thermal ComfortC
Comfortable2/20/2023Thermal ComfortC
Comfortable2/20/2023Thermal ComfortC
Comfortable3/2/2023Thermal ComfortA
Comfortable3/2/2023Thermal ComfortA
Comfortable3/3/2023Thermal ComfortB
1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

Check this file.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

Check this file.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Ashish, creating a new table with a continuous calendar resolved the issue. Thank you for providing the sample file.

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anand24
Super User
Super User

Hi @lexiko80 ,
Try changing ALL(Sheet1[Observation]) to ALLSELECTED(Sheet1[Observation], Sheet1[Datestamp])

 

PBI_SuperUser_Rank@1x.png  

Give a Thumbs Up if this post helped you in any way and Mark This Post as Solution if it solved your query !!!

Proud To Be a Super User !!!
LinkedIn

Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors