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

Create a Card that hides or shows values depending on the filter selection

Hi!

I would like to create a card that is dependent of a filter selection.

So, i am using conditional formating to solve this issue. I have a date visual that looks like this:

Date Visual v2 = IF(ISFILTERED('MTD/QTD/YTD Selection_v2'),"MTD "&MAX('MTD/QTD/YTD Selection_v2'[YEAR/MONTH]),(" "))

This works fine. Although when i am not selecting MTD or PMTD i want the text to be white or blank and therfore i created this measure to conditional format with:

Make Transparent Measure = IF(SELECTEDVALUE('MTD/QTD/YTD Selection_v2'[Selection]) = "MTD" && "PMTD", "#000000",
IF(SELECTEDVALUE('MTD/QTD/YTD Selection_v2'[Selection]) = "MTD" || "PMTD", "#000000","#FFFFFF" ))

with the above mentioned measure i get an error:
"Cannot convert value 'PMTD' of time text to type True/False" and i guess that is because i have 2 values instead of one.

Is there a way to bypass this or use another dax-format to get the expected result?

Kind Regards
D.Z

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

Please have a try.

Date Visual v2 =
IF (
    SELECTEDVALUE ( 'MTD/QTD/YTD Selection_v2' ) <> BLANK (),
    "MTD " & MAX ( 'MTD/QTD/YTD Selection_v2'[YEAR/MONTH] ),
    ( " " )
)

 

If it does not help, please provide more details with your desired output and pbix file without  priavcy information.

 

Best Regards

Community Support Team _ Polly

 

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

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @Anonymous ,

Please have a try.

Date Visual v2 =
IF (
    SELECTEDVALUE ( 'MTD/QTD/YTD Selection_v2' ) <> BLANK (),
    "MTD " & MAX ( 'MTD/QTD/YTD Selection_v2'[YEAR/MONTH] ),
    ( " " )
)

 

If it does not help, please provide more details with your desired output and pbix file without  priavcy information.

 

Best Regards

Community Support Team _ Polly

 

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

Anonymous
Not applicable

A similar solution to this is what i am after:

IF (
SELECTEDVALUE ( 'MTD/QTD/YTD Selection_v2'[Selection] ) = "MTD" && "PMTD" ,
"MTD " & MAX ( 'MTD/QTD/YTD Selection_v2'[YEAR/MONTH] ),
(" ")
)
Becuse that calculation gives me an error.
"Cannot convert 'PMTD' of type Text to type True/False
Anonymous
Not applicable

Hi @Anonymous amd thank you for your answer!

Unfortunately that is not quite what i am after. That works fine if i have one value!

But what if i filter MTD & PMTD then the card will become blank

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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