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 everyone,
Am looking for a way to control the value of a categorial feature in the bar chart by changing select list.
Details are as follows.
There are two tables (A&B) which is attached below. In Table A, there is ITEM A and B. In Table B, there is ITEM C1 and C2.
The bar chart is categorized by ITEM.
The value of ITEM A from Table A is shown in bar A. Value of ITEM B from Table A is shown in bar B.
At for C1 and C2 of Table B, which one is going to be shown in the categorial feature ITEM C in the bar chart, should be selectable.
If C1 is chosen, the value of ITEM C1 in Table B, which is 300, will be shown in the bar chart as C.
If C2 is chosen, the value of ITEM C2 in Table B, which is 400, will be shown in the bar chart as C.
Anyone with good idea?
If any further infomation is needed please feel free to contact.
Thank you very much.
Solved! Go to Solution.
There are many ways of doing this but the safest will be to have a disconnected reference table with Items A,B,C and then create a measure that cacluates the value for each item.
Hi @Anonymous
Has Ibendlin's response solved your problem? If so, please accept his reply as the solution.
If you still need more detailed steps, please refer below:
1. Create a table containing ITEM ABC and do not create relationships with other tables.
ITEMS = DATATABLE(
"ITEM", STRING,
{
{"A"},
{"B"},
{"C"}
}
)
2. Create a measure for each ITEM.
ITEM A VALUE =
IF(
MAX(ITEMS[ITEM]) = "A",
CALCULATE(SUM('Table A'[VALUE]), 'Table A'[ITEM] = "A"),
BLANK()
)
ITEM B VALUE =
IF(
MAX(ITEMS[ITEM]) = "B",
CALCULATE(SUM('Table A'[VALUE]), 'Table A'[ITEM] = "B"),
BLANK()
)
ITEM C VALUE =
IF(
MAX(ITEMS[ITEM]) = "C",
SWITCH(
TRUE(),
SELECTEDVALUE('Table B'[ITEM]) = "C1", CALCULATE(SUM('Table B'[VALUE]), 'Table B'[ITEM] = "C1"),
SELECTEDVALUE('Table B'[ITEM]) = "C2", CALCULATE(SUM('Table B'[VALUE]), 'Table B'[ITEM] = "C2"),
BLANK()
),
BLANK()
)
3. Creating a slicer using the ITEM field of TABLE B. In the bar chart, the ITEM of the ITEM table is used as the Y-axis, and the measures of the three ITEMs are used as the X-axis.
Best Regards,
Jarvis Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
There are many ways of doing this but the safest will be to have a disconnected reference table with Items A,B,C and then create a measure that cacluates the value for each item.
Hi Ibendlin,
Thank you so much for your reply.
Will try this way.
Hi @Anonymous
Has Ibendlin's response solved your problem? If so, please accept his reply as the solution.
If you still need more detailed steps, please refer below:
1. Create a table containing ITEM ABC and do not create relationships with other tables.
ITEMS = DATATABLE(
"ITEM", STRING,
{
{"A"},
{"B"},
{"C"}
}
)
2. Create a measure for each ITEM.
ITEM A VALUE =
IF(
MAX(ITEMS[ITEM]) = "A",
CALCULATE(SUM('Table A'[VALUE]), 'Table A'[ITEM] = "A"),
BLANK()
)
ITEM B VALUE =
IF(
MAX(ITEMS[ITEM]) = "B",
CALCULATE(SUM('Table A'[VALUE]), 'Table A'[ITEM] = "B"),
BLANK()
)
ITEM C VALUE =
IF(
MAX(ITEMS[ITEM]) = "C",
SWITCH(
TRUE(),
SELECTEDVALUE('Table B'[ITEM]) = "C1", CALCULATE(SUM('Table B'[VALUE]), 'Table B'[ITEM] = "C1"),
SELECTEDVALUE('Table B'[ITEM]) = "C2", CALCULATE(SUM('Table B'[VALUE]), 'Table B'[ITEM] = "C2"),
BLANK()
),
BLANK()
)
3. Creating a slicer using the ITEM field of TABLE B. In the bar chart, the ITEM of the ITEM table is used as the Y-axis, and the measures of the three ITEMs are used as the X-axis.
Best Regards,
Jarvis Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
6 | |
6 | |
3 | |
2 | |
2 |