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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
LT4RFF
Helper I
Helper I

How do I create a Y-Axis Constant Line that is unique to the item I am selecting in the dropdown box

Hello,

 

I have a line graph that shows me the financial increase per day per catastophie.

 

Example below: 

 

Screenshot 2025-03-06 150740.png

 

What I would like is a line running across that graph to tell me when I'm about to reach or exceed the reporting threshold

 

Like so 

Screenshot 2025-03-06 151401.png

 

I can obviously do that using the Y-Axis constant line

 

Screenshot 2025-03-06 151548.png

 

What I would like is for this reporting threshold line to change every time I pick a new catastophie from the drop down box..

 

Because if I pick a different CAT from the drop down box - Hurricane Helene - the reporting threshold from the wildfire is still there

 

 

Screenshot 2025-03-06 152221.png

 

I want it to look like this when I change CAT

 

Screenshot 2025-03-06 152416.png

 

To put it simply - How do I create a Y-Axis Constant Line that is unique to the item I am selecting in the dropdown box?

 

Let me know if I haven't explained that properly.

 

Thanks

1 ACCEPTED SOLUTION
v-linhuizh-msft
Community Support
Community Support

Thanks for the reply from Deku.

 

Hi @LT4RFF ,

                                                                                                                                                                                 

As Deku said, you can create a measure and set up conditional formats.

Here is a simple example using sample data:

Measure = SWITCH(SELECTEDVALUE('financials'[Country]),"Canada",10000000,"France",20000000,0)

vlinhuizhmsft_0-1741332852840.png

Results:

vlinhuizhmsft_1-1741332880003.png

vlinhuizhmsft_2-1741332894021.png

 

 

Best Regards,
Zhu

 

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

 

View solution in original post

(Virus scan in progress ...)
5 REPLIES 5
LT4RFF
Helper I
Helper I

Thanks for the responses @Deku and @v-linhuizh-msft 

 

I'm getting this error

 

'Too many arguement were passed to the SELECTEDVALUE functon. The maximum argument count for function is 2'

 

Screenshot 2025-03-07 093231.png

 

Is it because I deviated from your code?

 

You wrote "financials[Country]' and I replaced it with 'Weekly CAT Report' [CAT Name]' which looked like the most logical.

 

I want the numbers to dynamically change when I pick a different CAT from the 'CAT Name' dropdown box.

Hi @LT4RFF 

 

Insert a closing parenthesis ) immediately following 'Weekly CAT Report'[CAT Name] 



Proud to be a Super User!

daxformatter.com makes life EASIER!

Thanks - I literally just spotted that and fixed it as you replied.

 

It works.

 

Thank you so much

v-linhuizh-msft
Community Support
Community Support

Thanks for the reply from Deku.

 

Hi @LT4RFF ,

                                                                                                                                                                                 

As Deku said, you can create a measure and set up conditional formats.

Here is a simple example using sample data:

Measure = SWITCH(SELECTEDVALUE('financials'[Country]),"Canada",10000000,"France",20000000,0)

vlinhuizhmsft_0-1741332852840.png

Results:

vlinhuizhmsft_1-1741332880003.png

vlinhuizhmsft_2-1741332894021.png

 

 

Best Regards,
Zhu

 

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

 

(Virus scan in progress ...)
Deku
Responsive Resident
Responsive Resident

Next to the value of 8000000 you entered is a fx symbol. You can define a measure, affected by the drop down to have a dynamic line that you can assign there

Helpful resources

Announcements