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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

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
Anonymous
Not applicable

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
Solution Sage
Solution Sage

Hi, @Anonymous 

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!




Anonymous
Not applicable

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, @Anonymous 

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, @Anonymous 

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

Anonymous
Not applicable

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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