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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Anonymous
Not applicable

How to Sync Slicer to meassure?? (Accumulated Totals)

I want a meassure with accumulated totals to be affected by a Slicer. 

 

Titles_released_acumulated_total =
CALCULATE (
    COUNT ( game_info[Genre] ),
    FILTER (
          ALL (game_info) ,
        game_info[Date2] <= MAX ( game_info[Date2] )
    ),
    game_info[Genre] = "Action"
)
 
Instead of "Action" I want to put there the genre selected in the Slicer. 
 
As you´ll see in the photo.  Even though I selected "Platform" in the Slicer, the meassure still counts for "action" (obviously) but how do I sync it with the slicer? 
As you can see, the meassure in the linegraph is not affected by my filterAs you can see, the meassure in the linegraph is not affected by my filter
1 ACCEPTED SOLUTION
VahidDM
Super User
Super User

Hi @Anonymous 

 

The best solution for you is to add a date table to your model and set your date filter by using that table, BTW, try this:

Titles_released_acumulated_total =
VAR _Genre =
    SELECTEDVALUE ( game_info[Genre] )
RETURN
    CALCULATE (
        COUNT ( game_info[Genre] ),
        FILTER (
            ALL ( game_info ),
            game_info[Date2] <= MAX ( game_info[Date2] )
                && game_info[Genre] = _Genre
        )
    )

 

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

Appreciate your Kudos!! 

Badges.jpg

LinkedIn | Twitter | Blog | YouTube 

View solution in original post

2 REPLIES 2
VahidDM
Super User
Super User

Hi @Anonymous 

 

The best solution for you is to add a date table to your model and set your date filter by using that table, BTW, try this:

Titles_released_acumulated_total =
VAR _Genre =
    SELECTEDVALUE ( game_info[Genre] )
RETURN
    CALCULATE (
        COUNT ( game_info[Genre] ),
        FILTER (
            ALL ( game_info ),
            game_info[Date2] <= MAX ( game_info[Date2] )
                && game_info[Genre] = _Genre
        )
    )

 

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

Appreciate your Kudos!! 

Badges.jpg

LinkedIn | Twitter | Blog | YouTube 

Anonymous
Not applicable

Thank you so much. You saved me.  The code works perfectly. I have a calendar table so I will try to adjust your code for that. 

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.