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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
GvidoB
Frequent Visitor

Top 100 in a specific month-year with out using a visual to select a month-year combination

Hi Community,

 

I' m struggling with making this measure static for a specific month-year combination:

 

Top 100 April =

    calculate(
        [Values],
        filter(datetable,MONTH(datetable[Date])=4),
        filter(datetable,year(datetable[Date])=2018),
        FILTER( values(Users[Name]) ,
                    rankx ( all( Users[Name]) , [Values] , , desc ) <=100)

)

 

I need to add the bolded filters inside the last filter so that it would rank users by value in April - 2018, but nothing has worked so far. Currently it ranks users by value at all time, and then calculate value of these users in 4-2018.

 

I' d appreciate some tips! Thank you,

 

Gvido

1 ACCEPTED SOLUTION
v-yuta-msft
Community Support
Community Support

Hi GvidoB,

 

Modify the measure like below and check if it can work.

 

Top 100 April =
RANKX (
    ALL ( users ),
    CALCULATE (
        [Values],
        FILTER (
            datetable,
            MONTH ( datetable[Date] ) = 4
                && YEAR ( datetable[Date] ) = 2018
        )
    ),
    ,
    desc
)

Regards,

Jimmy Tao

 

View solution in original post

1 REPLY 1
v-yuta-msft
Community Support
Community Support

Hi GvidoB,

 

Modify the measure like below and check if it can work.

 

Top 100 April =
RANKX (
    ALL ( users ),
    CALCULATE (
        [Values],
        FILTER (
            datetable,
            MONTH ( datetable[Date] ) = 4
                && YEAR ( datetable[Date] ) = 2018
        )
    ),
    ,
    desc
)

Regards,

Jimmy Tao

 

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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