Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi Team,
Source table
Table A |
Script ID | Category | Relience | Tata | Godrej | TCS | Colgate |
1 | Equity | 100 | 150 | 120 | 140 | 160 |
2 | Comm | 210 | 120 | 235 | 147 | 135 |
Table B |
Script ID | Category | MF |
1 | Equity | 170 |
2 | Comm | 180 |
Reqirment : i want to create a bar graph when user select category from the slicer and bar graph it should present
Relience | Tata | Godrej | TCS | Colgate |
MF |
and sort by the low to high value
Note:- we dont want to pivot/unpivot the source data
Thanks
Solved! Go to Solution.
Hi @Anshenterprices ,
I suggest you to create a Dimtable with column headers as "Relience","Tata","Godrej","TCS","Colgate" you need.
Axis =
{"Colgate","TCS","Godrej","Tata","Relience"}
Then create a measure to calcualte the sum of value.
Measure =
SWITCH(
MAX('Axis'[Axis]),
"Colgate",CALCULATE(SUM('Table A'[Colgate])),
"TCS",CALCULATE(SUM('Table A'[TCS])),
"Godrej",CALCULATE(SUM('Table A'[Godrej])),
"Tata",CALCULATE(SUM('Table A'[Tata])),
"Relience",CALCULATE(SUM('Table A'[Relience]))
)
Create a bar chart by Axis[Axis] in Axis and [Measure] in Value, then you can sort your visual by measure.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@amitchandak Can you please explain how to do that? Based on the values it will sort?
thank you
@Anshenterprices , Create 5 measures and put them in visual in the order you want
@amitchandak but those are already a seperate columns and its a meausure ? Can you please explain how to do that? Based on the values it will sort?
thank you
Hi @Anshenterprices ,
I suggest you to create a Dimtable with column headers as "Relience","Tata","Godrej","TCS","Colgate" you need.
Axis =
{"Colgate","TCS","Godrej","Tata","Relience"}
Then create a measure to calcualte the sum of value.
Measure =
SWITCH(
MAX('Axis'[Axis]),
"Colgate",CALCULATE(SUM('Table A'[Colgate])),
"TCS",CALCULATE(SUM('Table A'[TCS])),
"Godrej",CALCULATE(SUM('Table A'[Godrej])),
"Tata",CALCULATE(SUM('Table A'[Tata])),
"Relience",CALCULATE(SUM('Table A'[Relience]))
)
Create a bar chart by Axis[Axis] in Axis and [Measure] in Value, then you can sort your visual by measure.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
111 | |
93 | |
87 | |
35 | |
35 |
User | Count |
---|---|
154 | |
102 | |
82 | |
64 | |
54 |