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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
ArtemisRaeWJ
Regular Visitor

Slicer with different output

Hi community, I need guidance on this particular request.
I have a PBI port-to-port dashboard. The objective is to show types of port services & lead time from point A to point B in our existing trade in the database. Current roadblock is user want to show other output under the same group name & it needs to be dynamic. Here a sample data table:-

Port_CodePort_NameGroup_Name
ADLAdelaideSouthern Australia
HBAHobartSouthern Australia
MELMelbourneSouthern Australia
SYDSydneySouthern Australia
TSVTownsvilleSouthern Australia

 

Example scenario :-
If I select "Adelaide" in the "Port of Loading" Slicer & "Laem Chabang" in the "Port of Discharge" slicer, in the table output must show the alternative ports in "Port of Loading" that is under "Southern Australia" group name which is Adelaide, Melbourne & Sydney. 
User also requested to do away of including group name in the hierarchy drop down slicers.
Slicer Layout

ArtemisRaeWJ_2-1738084209643.png

 

Table output

ArtemisRaeWJ_1-1738084046338.png

 

I have tried to adapt one of the DAX from YT video by SQLBI  Show last 6 months based on user single slicer selection that might work for this requirement, but I got a blank output

 

 

 

POL Outbound Select = 
VAR SelectedPOL = SELECTEDVALUE('data_sample'[Port_of_Loading])
VAR ReferenceGroupNameBySelectedPortName =
    IF(
        NOT(ISBLANK(SelectedPOL)),
        CALCULATE(
            FIRSTNONBLANK('data_sample'[Port_of_Loading_Group_Name], 1),
            'data_sample'[Port_of_Loading] = SelectedPOL
        ),
        BLANK() 
    )
VAR Result =
    CALCULATE(
        SELECTEDMEASURE(),
        REMOVEFILTERS('data_sample'[Port_of_Loading_Group_Name]),
        REMOVEFILTERS('alt_data_sample'[Port_of_Loading]), // from dim table of 'data_sample'
        FILTER(
            'data_sample',
            'data_sample'[Port_of_Loading_Group_Name]
        ), 
        USERELATIONSHIP('data_sample'[Port_Code], 'alt_data_sample'[Port_Code])
    )
RETURN
    Result

 

 

Sample PBIX file

Hope to get some help on this matter here or other workaround & let me know if you need more infomation. Thank you in advance

4 REPLIES 4
ArtemisRaeWJ
Regular Visitor

Hi all,

I have found the solution for this case.

CountRows PortGroups = 
VAR _selectedPortGroup = SELECTEDVALUE(helpTable[Port Group])

RETURN

CALCULATE(COUNTROWS(originalTable), originalTable[Port Group] = _selectedPortGroup)

Credits to Reddit user: frithjof_v. Click here for more info in the steps

 

Anonymous
Not applicable

Hi @ArtemisRaeWJ ,

 

Really glad to hear that your problem has been solved.

If possible, please accept it as a solution. More people will benefit from your reply.

Best Regards,
Stephen Tao

 

Anonymous
Not applicable

Hi @ArtemisRaeWJ ,

 

Thanks for reaching out to us.

Not very clear about your requirement. Why did you choose "Laem Chabang" to return to "Southern Australia", and how are the two related in the data model?

Please describe the relationship between them in more detail.

 

Best Regards,
Stephen Tao

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

Hi @Anonymous,
This requirement is related to Port-to-port dashboard which consist of types of port services & lead time. The earlier given example is actually one of the seaport from point A to point B in the existing trade from the database. There are long list of other port names

ArtemisRaeWJ_0-1738157510812.png


Because the user wants to "force" showing other ports when selected the port name that is under the same category (which is the group name) instead of having a hierarchy dropdown slicer the group name which the user rejected

ArtemisRaeWJ_1-1738157771413.png

I have included a sample PBIX for testing

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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