Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi Team,
I am using a Line & Stacked Column chart and passing 7 metrics in Column Y - axis (in image below A- G)
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.
Solved! Go to Solution.
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.
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.
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.
There is another table as a slicer, and there is no relationship between the two tables. Then I created five measures.
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:
The following is the specific approach of SamWiseOwl‘s method I understand, for your reference:
Select Field Parameter
In the Table view interface, right-click Parameter and select New group.
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.
Output:
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.
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.
There is another table as a slicer, and there is no relationship between the two tables. Then I created five measures.
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:
The following is the specific approach of SamWiseOwl‘s method I understand, for your reference:
Select Field Parameter
In the Table view interface, right-click Parameter and select New group.
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.
Output:
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.
@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.
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.
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?
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.
User | Count |
---|---|
76 | |
75 | |
46 | |
31 | |
27 |
User | Count |
---|---|
99 | |
91 | |
51 | |
49 | |
45 |