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
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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.