cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ladyhaley
Resolver I
Resolver I

Show and Hide legend/value in a line visual

Hello, 

I have a line visual that I want to show three values (Actual, Budget, LY Actual) to compare the trends. These values are all calcluated measures.

However, I want to be able to choose which lines I am comparing, lets say I want to either compare Actual vs Budget or Actual vs LY. Therefore only showing only two lines at any given time, how would I do this without having to create two different visuals and using book marks?

I have other book marks on the page and couldnt get them to interact correctly. 

1 ACCEPTED SOLUTION

Hi, thank you for your answer. I found this solution to work but been busy working away and forgot to update: show or hide measures using slicer 

View solution in original post

5 REPLIES 5
ALLUREAN
Super User
Super User

Hi, @ladyhaley 

Probably you need to create a switch measure between Actual, Budget and LY and use it instead of the 3 measures)

1. Create a simple table with three Values: Actual, Budget, LastYear e.g. SwitchTable and column name Type

2.

SwitchMeasure =

SWITCH(TRUE(),
SELECTEDVALUE(SwitchTable[Type] = "Actual", [ActualMeasure],

SELECTEDVALUE(SwitchTable[Type] = "Budget", [BudgetMeasure],

SELECTEDVALUE(SwitchTable[Type] = "LastYear", [LastYearMeasure]

)

3. Use Type as slicer and on X-Axis




Did I answer your question? Mark my post as a solution!


https://allure-analytics.com/
https://www.youtube.com/channel/UCndD_QZVNB_JWYLEmP6KrpA
https://www.linkedin.com/company/77757292/

Proud to be a Super User!




These dont have a column value associated. My data looks something like this:

Week EndingCustomerActual Budget
20/01/2020A100120
20/02/2020B3020
20/01/2021C4035

 

My Measures:

 

Actual: Calculate(SUM(Actual), Filter(All[DateTable], Date[Year] = SELECTEDVALUE(Date[Year] ))) 
Budget: Calculate(SUM(Budget), Filter(All[DateTable], Date[Year] = SELECTEDVALUE(Date[Year] ))) 
LY Actual: Calculate(SUM(Actual), Filter(All[DateTable], Date[Year] = SELECTEDVALUE(Date[Year]  - 1))) 

 

 

I then drag these into the visuals, now I am stuck on how I can even create a slicer for them 😞

Hi, @ladyhaley 

m_Actual1 = IF("Actual" in VALUES(Table2[Measure]),sum('Table'[Actual]),BLANK()) 
m_Budget2 = IF("Budget" in VALUES(Table2[Measure]),sum('Table'[Budget]),BLANK()) 

Please check my attatched sample file for more information.

 

Best Regards,
Community Support Team _ Eason

 

Hi, @ladyhaley 

I'm a little confused about the measures you provided. Do you need to calculate each indicator by year?

Please test if @ALLUREAN ‘s method works for you.

You can also refer to this document to implement dynamic measure/axis.

Dynamic EVERYTHING (measures, axis, legend, titles, chart types) 

 

Best Regards,
Community Support Team _ Eason

Hi, thank you for your answer. I found this solution to work but been busy working away and forgot to update: show or hide measures using slicer 

Helpful resources

Announcements
September Update

Check it Out!

Click here to learn more about the September 2022 updates!

Power BI Dev Camp Session 26

Check it Out!

Mark your calendars and join us on Thursday, September 29 at 11a PDT for a great session with Ted Pattison!

Top Solution Authors