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
VbOnline
Frequent Visitor

Disconnected Table - Filter the List of Items on X Axis (and not measure), is it Possible?

All

 

I have a situation where in, based on selection of a particular "Station" from a slicer, I need to get all "OTHER" stations which are of same Size (by number of trains arriving and departing) and show those other stations in the Bar Graph X Axis and a measure for those station.

 

I have seen lot of posting or video's where, people have used disconnected table to calculate a measure and restrict the measure. But this is restricting the Measure (typically on Y Axis) but no example to filter X axis.

 

The below is my base data set:

StationCodeStationSizeStationArrivalsStationDepartures
HYD52231
SEC52133
MAS83445
BOM125464
BLR52243
BPL43422
KOL123423

 

The user will come and select a station, lets assume HYD. Based on that selection, I can get the Size by using SELECTEDVALUE or LOOKUP. So, I get a value of 5.

 

Using that 5, I need to pick up all stations with size of 5, that will give me BLR, SEC and HYD.

 

For these three stations, I need to show a graph where the Station is on X Axis and the arrival/departure count is on Y Axis.

 

How is it possible to restrict the X axis (stations to show), is Disconnected table a solution? For example, the below is how the bar graph will look like but it will only show 3 stations than 7 stations in my table.

 

VbOnline_0-1664379136379.png

 

Any help is appreciated, either via Disconnected Table or any other mechanism.

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

You could set up a disconnected table as

Station slicer = ALLNOBLANKROW(Stations[Name], Stations[Size])

and use that in a slicer. Then create a measure like

Station is visible =
VAR VisibleStations =
    CALCULATETABLE (
        VALUES ( Stations[Name] ),
        TREATAS ( VALUES ( 'Station slicer'[Size] ), Stations[Size] )
    )
RETURN
    IF ( SELECTEDVALUE ( Stations[Name] ) IN VisibleStations, 1 )

and use that as a visual level filter on your bar chart, to only show when the value is 1.

View solution in original post

4 REPLIES 4
v-xiaosun-msft
Community Support
Community Support

Hi @VbOnline ,

 

According to your description, here is my solution.

Create a measure to get the size when you select the “StationCode” in slicer.

 

Measure =
IF (
    SELECTEDVALUE ( 'Table'[StationCode] ) = MAX ( 'Table'[StationCode] ),
    MAX ( 'Table'[StationSize] )
)

 

vxiaosunmsft_0-1664443694578.png

Create a table.

 

Table 2 =
SUMMARIZE ( 'Table', 'Table'[StationCode], 'Table'[StationSize] )

 

Create a measure to get the “StationCode” with the same size.

 

Measure2 =
IF ( 'Table'[Measure] = MAX ( 'Table 2'[StationSize] ), 1 )

 

vxiaosunmsft_1-1664443755048.png

Put columns to a chart.

 vxiaosunmsft_2-1664443755052.png

Final output:

vxiaosunmsft_3-1664443755054.png

 

I attach my sample below for your reference.

 

Best Regards,
Community Support Team _ xiaosun

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

@v-xiaosun-msft Thanks for your inputs and the PBIX file, I definately made progress with regards to restricting the stations in the bar graph meeting measure2. Only Problem next is, the Measures (Arrivals and Departures), insetad of showing the Bar Graph departures/Arrivals for specific stations, it is showing TOTAL of all Arrivals or Departures for the stations in the Graph.

 

I tried to create a measure (for example, Arrivals Divided by Departures to get a Percent) and add to the bar graph Y axis but that added all the stations. 

 

Any thoughts on how to get the measure accurate as appropriate for each station?

 

Thank You.

johnt75
Super User
Super User

You could set up a disconnected table as

Station slicer = ALLNOBLANKROW(Stations[Name], Stations[Size])

and use that in a slicer. Then create a measure like

Station is visible =
VAR VisibleStations =
    CALCULATETABLE (
        VALUES ( Stations[Name] ),
        TREATAS ( VALUES ( 'Station slicer'[Size] ), Stations[Size] )
    )
RETURN
    IF ( SELECTEDVALUE ( Stations[Name] ) IN VisibleStations, 1 )

and use that as a visual level filter on your bar chart, to only show when the value is 1.

@johnt75 I think this did the trick, I am able to use the methodology you explained to get the output I want. I use case I have given is for one criteria which is "Size", there are couple of more criterias I need to add, let me extend your methodology with those and get back.  thanks a lot for your inputs.

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.