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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
sanjayarun55
Frequent Visitor

bar chart using data from same table

Hi All,

 

I have a table with columns run id, claims, and treaty_name. i have 2 slicers which can choose one run id and another run id. i want to plot a bar chart with treaty_id as the x axis and the y axis having two bars one with claims from selected run id 1 and another with claims from selected run id 2.

 

is there a way to do this ?

 

basically my data LOOKS LIKE THIS and i want a bar chart with treaty_id in x axis with claims from run id 111 and run id 222 as bars in a bar chart. note i have many run ids so comparison can be between any two selected via slicers

run idtreaty_idyearclaims
111ABC202310
111ABC202420
111ABC202530
111DEF202340
111DEF202450
111DEF202560
222ABC202370
222ABC202480
222ABC202590
222DEF2023100
222DEF2024110
222DEF2025120

 

 

output:

sanjayarun55_0-1729543477080.png

 

2 ACCEPTED SOLUTIONS
KNP
Super User
Super User

I would go with one slicer with the run ids in it. 

Have some text telling report consumers to select two run ids to compare.

Create a measure for filtering the visual. 

Filter = IF(DISTINCTCOUNT(Table[runid]) = 2, 1, 0)

 

Put this filter in the filter pane against the chart and set it to "is 1"

 

The chart will only display if two run ids are selected.

 

Have I solved your problem?
Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;).
xOIEmaj

If you found this post helpful, please give Kudos.
It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen.
If you find my signature vaguely amusing, please give Kudos.
image
fabric-SUbadge
Proud to be a Super User!

View solution in original post

KNP
Super User
Super User

I don't know what your actual model looks like but it works better if you have the run ids in a separate table.

See attached modified file.

Hopefully you can work a solution from that.

 

Have I solved your problem?
Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;).
xOIEmaj

If you found this post helpful, please give Kudos.
It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen.
If you find my signature vaguely amusing, please give Kudos.
image
fabric-SUbadge
Proud to be a Super User!

View solution in original post

6 REPLIES 6
KNP
Super User
Super User

I don't know what your actual model looks like but it works better if you have the run ids in a separate table.

See attached modified file.

Hopefully you can work a solution from that.

 

Have I solved your problem?
Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;).
xOIEmaj

If you found this post helpful, please give Kudos.
It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen.
If you find my signature vaguely amusing, please give Kudos.
image
fabric-SUbadge
Proud to be a Super User!

Perfect this worked well.thanks for your solution.

ghoshabhijeet
Solution Supplier
Solution Supplier

@sanjayarun55  Here you go.

ghoshabhijeet_0-1729545582117.png

 

Here is the URL for the file: https://drive.google.com/file/d/1Yi6G5wFCI7QEu9b1uKQ-rgBksFEkcp0i/view?usp=sharing

 

 

** If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution, so that it comes in top of the search and help others. Thank you !

Good Luck 👍

 

KNP
Super User
Super User

I would go with one slicer with the run ids in it. 

Have some text telling report consumers to select two run ids to compare.

Create a measure for filtering the visual. 

Filter = IF(DISTINCTCOUNT(Table[runid]) = 2, 1, 0)

 

Put this filter in the filter pane against the chart and set it to "is 1"

 

The chart will only display if two run ids are selected.

 

Have I solved your problem?
Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;).
xOIEmaj

If you found this post helpful, please give Kudos.
It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen.
If you find my signature vaguely amusing, please give Kudos.
image
fabric-SUbadge
Proud to be a Super User!

thanks a lot implemented your idea and it worked

thanks a lot implemented your idea and it worked

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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