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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

July Newsletter

Fabric Community Update - July 2024

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