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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Line & Stacked Column Chart

Hi Team,

I am using a Line & Stacked Column chart and passing 7 metrics in Column Y - axis (in image below A- G)

Nikhil_567_0-1729667503659.png

Now the situation is we have a slicer for Channel, and it has two options X and Y.
If channel X is selected from the slicer, Measure "F" should be displayed in the bar and, measure "G" should be displayed in the bar if the other selction is made.

Any help will be appreciated.

2 ACCEPTED SOLUTIONS

What would you like to do with A to E?


If you are asking can you group measures then yes.
The easiest thing to do is use a Field Parameter:
https://learn.microsoft.com/en-us/power-bi/create-reports/power-bi-field-parameters

Then after you have created this swap to Table view, then Right click the first column in the table and choose New Group.

Assign each measure to the X or Y group.

SamWiseOwl_0-1729674506798.pngSamWiseOwl_1-1729674523842.pngSamWiseOwl_2-1729674547763.png

Using this in the visual will pull all the group measures through and you can filter the group to either X or Y.


If you are happy with this answer please mark as a solution for others to find !

Kudos are always appreciated! Check out our free Power BI video courses.

View solution in original post

Anonymous
Not applicable

Hi @Anonymous 

 

Thanks for the reply from SamWiseOwl, please allow me to add my opinion.

 

Do you want measure A-E to be displayed all the time, and then when "X" is selected in the slicer, show measure F, and when any other option is selected, show measure G? If so, please refer to the following test:

 

I am using the sample data from Power BI Desktop.

vxuxinyimsft_0-1730453848828.png

 

There is another table as a slicer, and there is no relationship between the two tables. Then I created five measures.

vxuxinyimsft_1-1730453955441.png

 

vxuxinyimsft_2-1730453965688.png

 

vxuxinyimsft_3-1730453989556.png

 

Then I created the following measure:

Output = IF(SELECTEDVALUE('Slicer'[Slicer]) = "X", [Measure 5], [Measure 4])

 

When I select "X", the visualization shows [Measure5], and when I select the other options, it shows [Measure4].

 

Output:

vxuxinyimsft_4-1730454139626.png

 

The following is the specific approach of SamWiseOwl‘s method I understand, for your reference:

 

Select Field Parameter

vxuxinyimsft_5-1730455324714.png

 

vxuxinyimsft_6-1730455393755.png

 

In the Table view interface, right-click Parameter and select New group.

vxuxinyimsft_7-1730455484730.png

 

Select the corresponding measure to create a group. Here I group [Measure4] and [Measure5] separately, and then add other measures to the "Other" group. The reason is that measures that have been added to a group cannot be reused. In other words, if other measures are grouped with any measure, they cannot be displayed together with another measure.

vxuxinyimsft_8-1730455512170.png

Output:

vxuxinyimsft_14-1730455919463.png

 

vxuxinyimsft_15-1730455935649.png

 

Best Regards,
Yulia Xu

 

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

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi @Anonymous 

 

Thanks for the reply from SamWiseOwl, please allow me to add my opinion.

 

Do you want measure A-E to be displayed all the time, and then when "X" is selected in the slicer, show measure F, and when any other option is selected, show measure G? If so, please refer to the following test:

 

I am using the sample data from Power BI Desktop.

vxuxinyimsft_0-1730453848828.png

 

There is another table as a slicer, and there is no relationship between the two tables. Then I created five measures.

vxuxinyimsft_1-1730453955441.png

 

vxuxinyimsft_2-1730453965688.png

 

vxuxinyimsft_3-1730453989556.png

 

Then I created the following measure:

Output = IF(SELECTEDVALUE('Slicer'[Slicer]) = "X", [Measure 5], [Measure 4])

 

When I select "X", the visualization shows [Measure5], and when I select the other options, it shows [Measure4].

 

Output:

vxuxinyimsft_4-1730454139626.png

 

The following is the specific approach of SamWiseOwl‘s method I understand, for your reference:

 

Select Field Parameter

vxuxinyimsft_5-1730455324714.png

 

vxuxinyimsft_6-1730455393755.png

 

In the Table view interface, right-click Parameter and select New group.

vxuxinyimsft_7-1730455484730.png

 

Select the corresponding measure to create a group. Here I group [Measure4] and [Measure5] separately, and then add other measures to the "Other" group. The reason is that measures that have been added to a group cannot be reused. In other words, if other measures are grouped with any measure, they cannot be displayed together with another measure.

vxuxinyimsft_8-1730455512170.png

Output:

vxuxinyimsft_14-1730455919463.png

 

vxuxinyimsft_15-1730455935649.png

 

Best Regards,
Yulia Xu

 

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

Anonymous
Not applicable

@SamWiseOwl Thanks for your response.

How about other measures from A to E?
Also these individual measures needs to be displayed in legends of the chart

What would you like to do with A to E?


If you are asking can you group measures then yes.
The easiest thing to do is use a Field Parameter:
https://learn.microsoft.com/en-us/power-bi/create-reports/power-bi-field-parameters

Then after you have created this swap to Table view, then Right click the first column in the table and choose New Group.

Assign each measure to the X or Y group.

SamWiseOwl_0-1729674506798.pngSamWiseOwl_1-1729674523842.pngSamWiseOwl_2-1729674547763.png

Using this in the visual will pull all the group measures through and you can filter the group to either X or Y.


If you are happy with this answer please mark as a solution for others to find !

Kudos are always appreciated! Check out our free Power BI video courses.

Anonymous
Not applicable

I would like to see all the measures from A to E as well apart from those two conditional measure.
can you please share pbix file where you have implemented this?

SamWiseOwl
Super User
Super User

Hi @Anonymous 

Could you create a measure to do this:
Swap F and G =
IF(
selectedValue(table[Channel]) = "X"

,[measure F]

,[measure G]
)


If you are happy with this answer please mark as a solution for others to find !

Kudos are always appreciated! Check out our free Power BI video courses.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.