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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
flying_bird
Frequent Visitor

problem with counting rows where a slicer has blanks

Hell all, i am new to power BI and got stuck with a problem. I am trying to update daily response rate in a dashboard. 

flying_bird_0-1740709268694.png

I have created three new measures: 

total invitation = countrows(Sheet1)
Cummulative responses (all responses up until the latest)
flying_bird_1-1740709341577.png

 

and then response rate as : 

divide([Cumulative Responses], [total invitation],0)
 
Then the numbers shown on dashboard are not correct:
flying_bird_2-1740709465143.png

I don't want total invitation to change based on the dates specified as they are not related. somehow Power BI thought this is what i need. Can anyone please advise?  The total invitation here should be 10 if i don't specify any other slicers...

Thanks a lot!

 

 

5 REPLIES 5
danextian
Super User
Super User

Hi @flying_bird 

 

For the total response rate

CALCULATE ( COUNTROWS ( Sheet1 ), REMOVEFILTERS ( Sheet1 ) )




Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Apologies. Seem like there are still issues. I think the problem is with how cummulative responses are defined.

 

i would love to have it defined as all the responses up to a single date i picked in the slicer. 

I expect 60% response rate for A and 40% rate for B when I select only 2/4/25 on the bar chart using the data i shared in my orginal post.

 

The card says one rate while the chart says another.

flying_bird_0-1740753480909.png

Can anyone please help?

 

Thank you.

Anonymous
Not applicable

Hi @flying_bird 

 

Please check if this is what you want. 

Total Cummulative Responses = 
CALCULATE(
    COUNTROWS(Sheet1),
    FILTER(
        ALL(Sheet1),
        Sheet1[Response Date] <= MAX(Sheet1[Response Date]) &&
        NOT(ISBLANK(Sheet1[Response Date]))
    )
)
Cummulative Responses = 
CALCULATE(
    COUNTROWS(Sheet1),
    ALLEXCEPT(Sheet1,Sheet1[Slicer 1]),
    Sheet1[Response Date] <= MAX(Sheet1[Response Date]),
    NOT(ISBLANK(Sheet1[Response Date]))
)
Response Rate = DIVIDE([Cummulative Responses], [Total Cummulative Responses], 0) 

vjingzhanmsft_0-1741157866362.png

Best regards, 

Jing

Irwan
Super User
Super User

hello @flying_bird 

 

please check if this accomodate your need.

Irwan_0-1740715567689.png

Irwan_1-1740715578569.png

 

1. create a new measure with following DAX for Total Invitation

Total Invitation = 
CALCULATE(
    COUNTROWS('Table'),
    ALL('Table')
)

2. create a new measure with following DAX for Cumulative Response (exact same DAX as yours)

Cumulative Response = 
CALCULATE(
    COUNTROWS('Table'),
    FILTER(
        'Table',
        'Table'[Response Date]<=MAX('Table'[Response Date])&&
        not ISBLANK('Table'[Response Date])
    )
)

3. create a new measure with following DAX for Response Rate (exact same DAX as yours)

Response Rate =
DIVIDE(
    [Cumulative Response],
    [Total Invitation]
)

Hope this will help.
Thank you.

This seems not working... but thank you for trying. 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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