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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
vimina
Frequent Visitor

Display Text based on date slicer selection

I have two slicers : Year and Period. Year is a single selector slicer and Period is multiselector. A Text needs to be displayed in a card based on the slicer selection.
If an year is selected and all the period of that year are selcted then display "Selected Year is '2022' " ELSE
if any period is selected for eg 1, 3,5 then display "Selected Range is for "Year" and Period 1,3,5"

vimina_0-1682772285807.png

pbix file: https://drive.google.com/file/d/1owzvBBV1ALzdNukg5pgjUaPApTgYDPaD/view?usp=sharing

1 ACCEPTED SOLUTION
vimina
Frequent Visitor

I have tweaked the below measure, if anybody is looking for the similar requirement then this measure can be used:

Modified Card Value =
IF(ISFILTERED('Date'[Year]) && ISFILTERED('Date'[Period]),
    "Selected Year is : " & FORMAT(SELECTEDVALUE('Date'[Year]), "0") & " And " &
    IF(DISTINCTCOUNT('Date'[Period]) = 1,
        "Selected Range is for Period: " & MIN('Date'[Period]),
        IF(MAX('Date'[Period]) - MIN('Date'[Period]) + 1 = DISTINCTCOUNT('Date'[Period]),
            "Selected Range is for Period: " & MIN('Date'[Period]) & " - " & MAX('Date'[Period]),
            "Selected Range is for Periods: " & CONCATENATEX(VALUES('Date'[Period]), 'Date'[Period], ", "))),
    "Selected Year is : " & FORMAT(SELECTEDVALUE('Date'[Year]), "0")

View solution in original post

2 REPLIES 2
vimina
Frequent Visitor

I have tweaked the below measure, if anybody is looking for the similar requirement then this measure can be used:

Modified Card Value =
IF(ISFILTERED('Date'[Year]) && ISFILTERED('Date'[Period]),
    "Selected Year is : " & FORMAT(SELECTEDVALUE('Date'[Year]), "0") & " And " &
    IF(DISTINCTCOUNT('Date'[Period]) = 1,
        "Selected Range is for Period: " & MIN('Date'[Period]),
        IF(MAX('Date'[Period]) - MIN('Date'[Period]) + 1 = DISTINCTCOUNT('Date'[Period]),
            "Selected Range is for Period: " & MIN('Date'[Period]) & " - " & MAX('Date'[Period]),
            "Selected Range is for Periods: " & CONCATENATEX(VALUES('Date'[Period]), 'Date'[Period], ", "))),
    "Selected Year is : " & FORMAT(SELECTEDVALUE('Date'[Year]), "0")
Ahmedx
Super User
Super User

pls try this

Card_Value = 
IF( ISFILTERED('Date'[Year])&&ISFILTERED('Date'[Period]),
        "Selected Year is : " & FORMAT(SELECTEDVALUE('Date'[Year]), "0") &" And  "&"Selected Range is for Period: " & MIN('Date'[Period]) & " - " & MAX('Date'[Period]),
        "Selected Year is : " & FORMAT(SELECTEDVALUE('Date'[Year]), "0")
)

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.