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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
HenryJS
Post Prodigy
Post Prodigy

Matrix: Count Text String in headers

Hi all,

 

I have the below measure in a matrix.

 

I would like to be able to 'Total' the count of "Yes" strings in the column and row headers.

 

Is this possible?

 

 

Timesheet? = IF(SELECTEDVALUE('Export Placements'[PlacementStartDate])<= MAX('Calendar'[Date]) && SELECTEDVALUE('Export Placements'[PlacementEndDate]) >= MAX('Calendar'[Date]), "Yes", BLANK())
 
 
Capture.JPG
1 ACCEPTED SOLUTION

Hi @HenryJS ,

 

Here we go:

Measure = 
IF (
    ISFILTERED ( 'Table'[date] ),
    IF (
        ISINSCOPE ( 'Table'[sub] ),
        MAX ( 'Table'[y/n] ),
        CALCULATE (
            DISTINCTCOUNT ( 'Table'[sub] ),
            FILTER ( 'Table', 'Table'[y/n] = "yes" )
        )
    ),
    BLANK ()
)

Capture.PNG

 

Pbix as attached

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

Use filtered and when scope is not date and what you have row, use the count measure

https://powerpivotpro.com/2013/03/hasonevalue-vs-isfiltered-vs-hasonefilter/

 

Count measure will same as yes measure but that will do sum

 

 

I am hosting a webinar on 25th April on Power BI, Check Details - https://www.linkedin.com/posts/amitchandak78_webinar-tech-techforgood-activity-6658266754378231808-y...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@Pragati11 

 

There would be counts of "Yes" where I have put red dots.

 

Capture.JPG

Hi @HenryJS ,

 

Here we go:

Measure = 
IF (
    ISFILTERED ( 'Table'[date] ),
    IF (
        ISINSCOPE ( 'Table'[sub] ),
        MAX ( 'Table'[y/n] ),
        CALCULATE (
            DISTINCTCOUNT ( 'Table'[sub] ),
            FILTER ( 'Table', 'Table'[y/n] = "yes" )
        )
    ),
    BLANK ()
)

Capture.PNG

 

Pbix as attached

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
Pragati11
Super User
Super User

Hi @HenryJS ,

 

Your query doesn't give enough details. Can you try sharing some data screenshots and the expected output screenshot?

 

Thanks,

Pragtai

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.