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

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

Reply
Ulal
New Member

ADD filter to existing measure

Hi Team, I have a measure,for this measure now i have to add an extra filter with MAX(MonthKey) column.

COUNTROWS(FILTER(ADDCOLUMNS(SUMMARIZE('SVDemo','SVDemo'[NationalIdNo],"Distinctpolicies", DISTINCTCOUNT('SVDemo'[PolicyTypeCd])), "policycount", [Distinctpolicies]), [policycount] =2))

 

 

Thak you

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Ulal ,

Please have a try.

measure =
VAR _1 =
    MAXX ( ALL ( 'SVDemo' ), 'SVDemo'[MonthKey] )
RETURN
    COUNTROWS (
        FILTER (
            ADDCOLUMNS (
                SUMMARIZE (
                    'SVDemo',
                    'SVDemo'[NationalIdNo],
                    "Distinctpolicies", DISTINCTCOUNT ( 'SVDemo'[PolicyTypeCd] )
                ),
                "policycount", [Distinctpolicies],
                "amonthy", 'SVDemo'[MonthKey] = _1
            ),
            [policycount] = 2
        )
    )

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

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

1 REPLY 1
Anonymous
Not applicable

Hi @Ulal ,

Please have a try.

measure =
VAR _1 =
    MAXX ( ALL ( 'SVDemo' ), 'SVDemo'[MonthKey] )
RETURN
    COUNTROWS (
        FILTER (
            ADDCOLUMNS (
                SUMMARIZE (
                    'SVDemo',
                    'SVDemo'[NationalIdNo],
                    "Distinctpolicies", DISTINCTCOUNT ( 'SVDemo'[PolicyTypeCd] )
                ),
                "policycount", [Distinctpolicies],
                "amonthy", 'SVDemo'[MonthKey] = _1
            ),
            [policycount] = 2
        )
    )

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

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

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!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Solution Authors
Top Kudoed Authors