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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
POSPOS
Post Partisan
Post Partisan

Count using DAX with page level filters

Hi,

I have a requirement to get three different count.

1. Total Count -- Sum of Active + Pending

2. Active Count -- Count of protocols with Active Date

3. Pending Count -- Count of protocols with blank Active Date

 

Sample Data:

Table 1:

POSPOS_0-1705602199778.png

Table 2:

POSPOS_1-1705602321675.png

 

Based on my requriement,I have a slicer and  I also have to apply page level filters as below:

POSPOS_2-1705602436338.png

I am unable to get the active count and total count. Pending count works fine. (Values should change based on slicer selection.)

 

POSPOS_3-1705602474226.png

Sample Pbix file is attached here.

 

Could someone pls help with the DAX for active count and total count?

Thank you.

13 REPLIES 13
Anonymous
Not applicable

@POSPOS  Do these expressions work for you?

Active Count =
CALCULATE(
    COUNTAX('Table','Table'[Protocol]),
    KEEPFILTERS(
        NOT ISBLANK(
            'Table'[Active Date]
        )
    )
)

Pending Protocols =
CALCULATE (
    COUNTAX ( 'Table', 'Table'[Protocol] ),
    KEEPFILTERS ( ISBLANK ( 'Table'[Active Date] ) )
)

Total Count =
[Active Count] + [Pending Protocols]

@Anonymous 
With the logic for Active Count , I am getting blank. Could you please share the pbix file if possible

Anonymous
Not applicable

@POSPOS  If Active Count = Count of protocols with Active Date, and your Active Date filter is (Blank), wouldn't you expect (Blank) in your Active Protocols card?

@Anonymous We would still want to show the active count as 5(in this case) in the initial view. Upon making any slicer selection, the action count will be blank.

Anonymous
Not applicable

@POSPOS  I'm sorry, but I'm not understanding. Can you be more clear about the requirements?

@Anonymous :
As per the same data provided,
Total count=8, Active count=5, Pending Count =3.
I am trying to show the above counts when there are no slicer selections.

When the slicer selection is made, eg: one protocol is selected in the slicer, then I would like to show the counts as
Total count=1, Active count=0, Pending Count =1.

Note: I would still want to retain the page level filters as below

POSPOS_0-1705614108326.png

 

Anonymous
Not applicable

@POSPOS  The Active and Pending counts will depend on which Protocol is selected, no?

@Anonymous 
We have other slicers are well in the actual report.
To replicate the issue, I have added only protocol as slicer.

Anonymous
Not applicable

@POSPOS  Here it is --> click

@Anonymous 
Thanks, we would still like to have the page level filters for active date and protocol number.
And the counts should also show in the intial view.

Idrissshatila
Super User
Super User

HEllo @POSPOS ,

 

check if this is the desired result

 

Idrissshatila_0-1705607345144.png

 

Active Protocols = 
CALCULATE(DISTINCTCOUNT('Table'[Protocol]),ALL('Table'),'Table'[Active Date] <> BLANK())

 

Total Count = 
CALCULATE(DISTINCTCOUNT('Table'[Protocol]),ALL('Table'))


Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




@Idrissshatila 
In the initial view the values for active count should show as 5 and when any slicer selections are made the value will be blank.

@Idrissshatila 
Values are as expected, but we also want the values  to change with slicers selection.
Now, the values are not changing with slicer selection.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.