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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
24Bart
New Member

COUNTROWS not returning count for a value, instead assigning it to count of other values.

Hi everyone,

I'm running into an issue that I just can't seem to wrap my head around, despite it appearing extremely basic.
The situtation is as follows.
I have the following measure:

Number Of Requests = 
IF (
    ISBLANK(COUNT(Aanvragen[Performance])),
    0,
    COUNT(Aanvragen[Performance])
)    

//Previously tried COUNTROWS(Aanvragen), which also did not work.

 

This measure refers to a calculated column in my primary fact table, Aanvragen, which tracks detailed information on incoming requests.


The DAX for this column is as follows:

Performance = 
VAR CriteriaNumber = 
IF ( 
    ISBLANK ( Aanvragen[closed_at] ),
    1,
    IF (
        RELATED('Aanvragen Prioriteiten'[value]) = "5",
        2,
        IF ( [Doorlooptijd Ticket] < RELATED('Dimensie Prioriteiten'[Maximale Looptijd] ),
            3,
            4
        )
    )
)

RETURN 
SWITCH( 
    CriteriaNumber,
    1, "In Behandeling",
    2, "Geen Deadline",
    3, "Op Tijd", 
    4, "Te Laat"
)

This calculated column continually returns the expected results.


However, when trying to combine the above measure and calculated column in a visual, with no slicers or filters active on it whatsoever, I get the following result:

24Bart_0-1680787057241.png

The configuration for completeness:

24Bart_1-1680787126274.png

Again, there are no filters or slicers present on any level. Not on the visual, nor the page, nor other pages synced with this one.

 

The strange thing is, though, that within this context, there should absolutely be a quantity of "In Behandeling" values to be counted.


I can't provide images of the source data, but I have repeatedly checked it in the data view and I do in fact see "In Behandeling" there, along with the other values.

What's even stranger is that when I add some card visuals to check how many times a unique value is being counted, the "In Behandeling" fields do seem to be counted (as the total value of the tallies adds up to the total unique rows being counted), but added to the tally of the three other present values. The ones also present in the visual shown above.
I also seem unable to determine the logic by which PowerBI is distributing the count for "In Behandeling" among the other value counts, to me it looks arbitrary. 

 

I'm hoping that some of the PowerBI guru's here can help me figure it out!

Thanks in advance.

 

 

1 ACCEPTED SOLUTION
24Bart
New Member

It seems I've found the problem.
A numer of values that weren't intended to be counted were actually counted. This accounts for the additional tally on the three present values.

The 4th value was absent because there was an invisible slicer still active on the page that didn't directly disable that value from being counted, but implicitly ended up doing so either way.
With the removal of this slicer things work as they should!

View solution in original post

2 REPLIES 2
24Bart
New Member

It seems I've found the problem.
A numer of values that weren't intended to be counted were actually counted. This accounts for the additional tally on the three present values.

The 4th value was absent because there was an invisible slicer still active on the page that didn't directly disable that value from being counted, but implicitly ended up doing so either way.
With the removal of this slicer things work as they should!

lbendlin
Super User
Super User

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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