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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.