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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Anonymous
Not applicable

Card to show an equivalent of excel countif

I have a card that i want to show the number of projects that where ProjectStatus = Active, and StatusRAG = Red.
I was using a filter on the card and that worked until I have started using bookmarks. When resetting the filters in the service, the filter on the cards are removed resulting in an incorrect value being shown.
I assume there is a more robust method for setting these values, can anybody suggest what is best?

 

PS, The card is using the following formula so that it will show 0 insted of (Blank)


zzMeasureProjectStatusActiveIF =
IF (
COUNTAX('Projects (2)', 'Projects (2)'[ProjectStatus] = "Active") = BLANK (),
"0",
COUNTAX('Projects (2)', 'Projects (2)'[ProjectStatus] = "Active")
)

1 ACCEPTED SOLUTION
vivran22
Community Champion
Community Champion

@Anonymous 

 

You may also use:

 

CountA Filter =
COUNTAX (
    'Projects (2),
    IF (
        'Projects (2)'[ProjectStatus] = "Active"
            && 'Projects (2)'[StatusRAG ] = "Red",
        'Projects (2)'[ProjectStatus]
    )
)

Rgds,

Vivek

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Anonymous ,

Have you solved your problem?

If you have solved, please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.

If you still need help, please share your data sample and your desired output so that we could help further on it.

Best  Regards,

Cherry

 

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
vivran22
Community Champion
Community Champion

Hi,

Has this been resolved?

Rgds,
Vivek
vivran22
Community Champion
Community Champion

@Anonymous 

 

You may also use:

 

CountA Filter =
COUNTAX (
    'Projects (2),
    IF (
        'Projects (2)'[ProjectStatus] = "Active"
            && 'Projects (2)'[StatusRAG ] = "Red",
        'Projects (2)'[ProjectStatus]
    )
)

Rgds,

Vivek

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

The better approach is to use calculate. 

 

Something like this (substitute your columns)

 

=CALCULATE(countrows(projects),projects[status]=“Active”,Projects[rag]=“Red”)



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors