Forum Discussion

baneworth's avatar
baneworth
Icon for Helper III rankHelper III
4 years ago
Solved

Dynamic Filter with Year and Qtr (SelectedValue)

Dear PowerBI Community,

 

if you could please help me out with a problem.

By looking around in here i found some ideas how to solve my issue but i couldnt quite figure it out.

 

My KPI card should include the selected calender (year or quarter) in the title dynamic.

   - quarter layout looks like 20221 for Q1 in 2022, 20222, etc

   - with SELECTEDVALUE(table(cal_qtr)) i can make it work to show the selected quarter

 

 

but when i select the whole year i want to show 2022 instead.

 

How could i make that DAX work?

 

Best regards

  • Hi baneworth ,

    According to your description, here's my solution. Create a measure.

     

    Title =
    IF (
        COUNTROWS ( ALLSELECTED ( 'Calendar'[Qtr] ) ) = 1,
        CONVERT ( SELECTEDVALUE ( 'Calendar'[Qtr] ), STRING ),
        CONVERT ( SELECTEDVALUE ( 'Calendar'[Year] ), STRING )
    )
    

     

    Turn on the card visual title and click the fx button.

    Select the measure in the dialoge.

    Get the result.

    I attach my sample below for reference.

     

    Best Regards,
    Community Support Team _ kalyj

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

2 Replies

  • Hi baneworth ,

    According to your description, here's my solution. Create a measure.

     

    Title =
    IF (
        COUNTROWS ( ALLSELECTED ( 'Calendar'[Qtr] ) ) = 1,
        CONVERT ( SELECTEDVALUE ( 'Calendar'[Qtr] ), STRING ),
        CONVERT ( SELECTEDVALUE ( 'Calendar'[Year] ), STRING )
    )
    

     

    Turn on the card visual title and click the fx button.

    Select the measure in the dialoge.

    Get the result.

    I attach my sample below for reference.

     

    Best Regards,
    Community Support Team _ kalyj

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