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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Apple08
Helper IV
Helper IV

Legends do not updated after view as role

Hi All

 

I have a chart below showing two suppliers' measures A and B in percentage.  They are two seperate measures one for A and one for B.  I have setup 'manage roles' for A and B, however when I view as A or B, the legend remains unchanged showing both A and B legends.  Please could anyone help me to sort this issue out?

 

Apple08_2-1678119099280.png

 

 

Before view as A or B:

 

Apple08_0-1678118129829.png

After A is selected in the view, the legends also include %B in the red box below:  If B is selected, A is also included in the legends, so the legends didn't update itself.

 

Apple08_1-1678118948536.png

Any help is appreciated.  Thanks.

1 ACCEPTED SOLUTION

Hmm ok, just to check you have:

 

'Supplier'[MMM-YY] on the x axis

 

% = DIVIDE ( [ Actual Hours Measure], [Capacity Hour Measure] ) on the y axis

 

'Supplier''[Name] in the legend

View solution in original post

10 REPLIES 10
AntonioM
Solution Sage
Solution Sage

Hi @Apple08 ,

 

I think because you've created two measures, both are always going to show in the legend.

 

When you view as A, although there's now no data for B, the % B measure is still in the visual so still shows in the legend - even though it's now blank.

 

Is there a way you can write a general % measure and then use a column with A and B values as the legend of the chart? That would stop B appearing in the legend as when viewing as A.

Thanks AntonioM.  My two measures are as below:

 

% A = divide([A Actual hours measure],[A Capacity Hours Measure])
%  B = divide([B Actual hours measure],[B Capacity Hours Measure])
 
A and B are in the 'Supplier'[Name].  I wonder how can I make them into one measure?  Thanks.

So could you create a generic [Actual Hours Measure] and [Capacity Hours Measure]? Just the totals, without any filtering on the name.

 

Then you could create % = DIVIDE ( [Actual Hours Measure], [Capacity Hours Measure] ) and put 'Supplier'[Name] in the legend of the chart.

 

Would that work?

Thanks.  I did try but the total combined into one line only rather seperate A and B into two lines.

Ok, could you tell me what the Actual and Capacity measures are? And maybe share some of the data in the table you're using

Thanks AntonioM.  

 

There is a table 'Supplier' of capacity hours for suppliers A and B by month for the whole financial year.

Capacity Hours Measure = sum('Supplier'[Capacity Hours])
 
The actual hours are obtained from anther table 'Task' and I get the actuals into the Supplier table by DAX below:
Actual Hours = SUMX(FILTER(Task[name]='Supplier'[name] && Task[MMM-YY]='Supplier'[MMM-YY]),Task[Actual])
 
Actual Hours measure = sum('Supplier'[Actual Hours])

Hmm ok, just to check you have:

 

'Supplier'[MMM-YY] on the x axis

 

% = DIVIDE ( [ Actual Hours Measure], [Capacity Hour Measure] ) on the y axis

 

'Supplier''[Name] in the legend

Thanks!  It works on the line graph 🙂

 

However, when I switch the graph to line and clustered column chart to show the column with % Plan vs Capacity, the lines showing % Actual vs Capacity, then only column legend is avaible to show A & B % Plan, but the line remains in one only.  I wonder is there anyway to split up the lines to second y-axis?  Many thanks.

Unfortunately, I don't think there is; the combo charts only allow one line.

There is an idea Microsoft Idea (powerbi.com) for exactly this but it's not a feature yet.

 

The only way to add more lines is with separate measures, but that's back to where we started again.

 

 

 

 

Thanks AntonioM for your kind explaination and effort.  I appreciate your help so much.  🙂

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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