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
RichOB
Post Patron
Post Patron

Measure to obtain values in a column

Hi, what measure would show in a card that there have been 7 instances where the fire service was called in the last 3 months, please?

 

MonthFire Service Called 
AprilYes
AprilNo
April Yes
AprilNo
MayNo
MayYes
MayYes
MayNo
JuneNo
JuneYes
JuneYes
June Yes
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @RichOB 

 

Please try this:
Here I create a measure:

MEASURE =
VAR _currentMonth =
    MONTH ( TODAY () )
RETURN
    COUNTROWS (
        FILTER (
            ALLSELECTED ( 'Table' ),
            MONTH ( 'Table'[Month] ) >= _currentMonth - 2
                && [Fire Service Called ] = "Yes"
        )
    )

The result is as follow:

vzhengdxumsft_0-1719198413087.png

 

 

Best Regards

Zhengdong Xu
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

2 REPLIES 2
Anonymous
Not applicable

Hi @RichOB 

 

Please try this:
Here I create a measure:

MEASURE =
VAR _currentMonth =
    MONTH ( TODAY () )
RETURN
    COUNTROWS (
        FILTER (
            ALLSELECTED ( 'Table' ),
            MONTH ( 'Table'[Month] ) >= _currentMonth - 2
                && [Fire Service Called ] = "Yes"
        )
    )

The result is as follow:

vzhengdxumsft_0-1719198413087.png

 

 

Best Regards

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

Anonymous
Not applicable

Edit the query in Power Query (Transform Data). Add a column to query that converts the Yes to 1 and No to 0. Save query and return to Power BI Desktop.

Add a measure that sums the new column - Service Called Count = SUM(<new column>)

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.