cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
DanZloo
Helper I
Helper I

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
v-rongtiep-msft
Community Support
Community Support

Hi @DanZloo ,

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
v-rongtiep-msft
Community Support
Community Support

Hi @DanZloo ,

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.

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

Hi @v-rongtiep-msft 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
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors