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
samnaw
Resolver I
Resolver I

Switch Max (tooltip) question

Hello:

 

I have made a tooltip and the dax code it works perfectly. Below is my code: 

 

2021_Event_Type = 
Switch(
Max('Table1'[WEEK]),
"1.6 W42", "Event1",
"1.7 W43", "Event2",
"2.8 W44", "Event3",
"2.8 W01", " ",
blank()
)

 

 

But now I want to add a condition week and FY = 2021

below is an incorrect code, but I want to do something like this:

 

2021_Event_Type = 
Switch(
Max('Table1'[WEEK] & 'Table1'[FY] = 2021),
"1.6 W42",  "Event1",
"1.7 W43",  "Event2",
"2.8 W44",  "Event3",
"2.8 W01",  " ",
blank()
)

 

How can I do this?

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@samnaw , Try like

 


2021_Event_Type =
Switch(
Max('Table1'[WEEK]) && MAX('Table1'[FY]) = 2021,
"1.6 W42", "Event1",
"1.7 W43", "Event2",
"2.8 W44", "Event3",
"2.8 W01", " ",
blank()
)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
v-jingzhang
Community Support
Community Support

Hi @samnaw , could you clarify your expected result more clearly?

 

In your Switch function, the Max('Table1'[WEEK] & 'Table1'[FY] = 2021) is used to compare with the values of "1.6 W42"/"1.7 W43"/... , but obviously they cannot be compared. What's the logic of the condition you want to realize? Will '2021' be involved in the values to be compared?

 

Best Regards,
Community Support Team _ Jing Zhang

amitchandak
Super User
Super User

@samnaw , Try like

 


2021_Event_Type =
Switch(
Max('Table1'[WEEK]) && MAX('Table1'[FY]) = 2021,
"1.6 W42", "Event1",
"1.7 W43", "Event2",
"2.8 W44", "Event3",
"2.8 W01", " ",
blank()
)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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.