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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Anonymous
Not applicable

dynamic dimension by select all or single value

Hi Experts,

 

Suppose we have region and city and a user selected filter by region.

If user chose one single region, there is a monthly trend line chart by city.( cities for each line by selected single region)

If user chose all or multiple region, there is a monthly trend line chart by region.(regions for each line)

Anyone can help?

 

Best Regards

Bruce Chen

1 ACCEPTED SOLUTION
v-frfei-msft
Community Support
Community Support

Hi @Anonymous ,

 

We can create a calculated table to work on it. One sample for your reference. Please check the following steps as below.

1. Create a calculated table and make it related to the fact table.

di = UNION(VALUES('Table'[city]),VALUES('Table'[region]))

2.PNG

2. Then we can create a measure as below to get the excepted result as we need.

Measure = 
IF (
    ISFILTERED ( 'Table'[city] ),
    SUM ( 'Table'[amount] ),
    IF (
        ISFILTERED ( 'Table'[region] ),
        CALCULATE (
            SUM ( 'Table'[amount] ),
            USERELATIONSHIP ( di[city / region], 'Table'[region] )
        )
    )
)

Capture.PNG

 

BTW, pbix as attached.

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

2 REPLIES 2
v-frfei-msft
Community Support
Community Support

Hi @Anonymous ,

 

We can create a calculated table to work on it. One sample for your reference. Please check the following steps as below.

1. Create a calculated table and make it related to the fact table.

di = UNION(VALUES('Table'[city]),VALUES('Table'[region]))

2.PNG

2. Then we can create a measure as below to get the excepted result as we need.

Measure = 
IF (
    ISFILTERED ( 'Table'[city] ),
    SUM ( 'Table'[amount] ),
    IF (
        ISFILTERED ( 'Table'[region] ),
        CALCULATE (
            SUM ( 'Table'[amount] ),
            USERELATIONSHIP ( di[city / region], 'Table'[region] )
        )
    )
)

Capture.PNG

 

BTW, pbix as attached.

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
Mariusz
Community Champion
Community Champion

Hi @Anonymous 

 

Unfortunately, there is no way to switch dynamically between columns or use measures in the Legend field of visuals, however, it would be a very powerful future.

 

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
Mariusz Repczynski

 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Solution Authors
Top Kudoed Authors