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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
paulvans182
Helper III
Helper III

IF Statement List based on measure results

Good afternoon,

 

I have the following calculation

 

Match Up Count Rows = CALCULATE(COUNTROWS('Game Fact'),FILTER('Game Fact','Game Fact'[Game Board]IN ALLSELECTED('Game Fact'[Game Board])))

 

 

If I place that measure in a table with Game ID, I get the following:

 Match Up Game Id Count.PNG

Is there a way that I can store the Game IDs where the Result is equal to 22 into a variable?  I would then like to be able to use that variable as part of a FILTER component for further CALCULATE expressions?

 

Kind regards,

Paul

1 ACCEPTED SOLUTION
AntrikshSharma
Super User
Super User

You could use something like this, also you can replace the whole FILTER with KEEPFILTERS and ALLSELECTED.

Match Up Count Rows =
VAR Something =
    FILTER (
        VALUES ( GameID ),
        CALCULATE (
            COUNTROWS ( 'Game Fact' ),
            KEEPFILTERS ( ALLSELECTED ( 'Game Fact'[Game Board] ) )
        ) = 22
    )
RETURN
    Something

  

View solution in original post

3 REPLIES 3
AntrikshSharma
Super User
Super User

You could use something like this, also you can replace the whole FILTER with KEEPFILTERS and ALLSELECTED.

Match Up Count Rows =
VAR Something =
    FILTER (
        VALUES ( GameID ),
        CALCULATE (
            COUNTROWS ( 'Game Fact' ),
            KEEPFILTERS ( ALLSELECTED ( 'Game Fact'[Game Board] ) )
        ) = 22
    )
RETURN
    Something

  

This is brilliant, thank you so much.

 

Kind regards,

Paul

You're welcome! 🙂

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.