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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
DanielLOOP
New Member

Filter to show branch and data from other branches in same region

Hi guys,

 

I am still pretty new in Power Bi, and this issue may be very simple, so I hope you are able to help min with this issue.

 

I want to create a page in Power Bi where I can select a branch and see there current revenue of the day, but at the same time I want to be presented with a list of the revenues from other branches in the same region.

 

Are there a way to filter a list of branches where the region is equal to the the branch you have chosesen?

 

Thank you in advance.

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

Hi @DanielLOOP 

Firstly your measure will show error due _Region will only return to value instead of a list. So Center[REGION] in _Region is not correct you should use "=" instead of "in". And this measure will only calculate the sum of revenues in same region as the brachch you select.

Measure = var _Region = MAXX(ALLSELECTED(Center),Center[REGION]
return
calculate([All Members],filter(all(Center),Center[REGION] in _Region

My Sample:

1.png

Calculate the revenue by all member measure.

All Members = SUM(Center[Revenue])

You can try to build an unrelated slicer table to achieve your goal.

Slicer = VALUES('Center'[Branch])

Then build a measure:

Measure = 
VAR _Branch = SELECTEDVALUE(Slicer[Branch])
VAR _Region = CALCULATE(MAX(Center[Region]), FILTER(ALL(Center),Center[Branch] = _Branch))
VAR _REVENUE = IF(ISFILTERED(Slicer[Branch]),IF(MAX(Center[Region]) = _Region,[All Members],BLANK()))
RETURN
_REVENUE

Result:

2.png

If we select Branch1 it will show all values in same Region.

3.png

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. 

 

 

View solution in original post

3 REPLIES 3
v-rzhou-msft
Community Support
Community Support

Hi @DanielLOOP 

Firstly your measure will show error due _Region will only return to value instead of a list. So Center[REGION] in _Region is not correct you should use "=" instead of "in". And this measure will only calculate the sum of revenues in same region as the brachch you select.

Measure = var _Region = MAXX(ALLSELECTED(Center),Center[REGION]
return
calculate([All Members],filter(all(Center),Center[REGION] in _Region

My Sample:

1.png

Calculate the revenue by all member measure.

All Members = SUM(Center[Revenue])

You can try to build an unrelated slicer table to achieve your goal.

Slicer = VALUES('Center'[Branch])

Then build a measure:

Measure = 
VAR _Branch = SELECTEDVALUE(Slicer[Branch])
VAR _Region = CALCULATE(MAX(Center[Region]), FILTER(ALL(Center),Center[Branch] = _Branch))
VAR _REVENUE = IF(ISFILTERED(Slicer[Branch]),IF(MAX(Center[Region]) = _Region,[All Members],BLANK()))
RETURN
_REVENUE

Result:

2.png

If we select Branch1 it will show all values in same Region.

3.png

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
Super User
Super User

@DanielLOOP , Try a measure like

 


measure =
var _region = maxx(allselected(Branch), Branch[region]) //assuming you have branch table
return
calculate(sum(Table]), filter(all(Branch) ,Branch[region] in _region))

 

 

This will work better if barch is an independent table 

 


measure =
var _region = maxx(allselected(Branch), Branch[region]) //assuming you have branch table
return
calculate(sum(Table]), filter(Table ,Table[region] in _region))

Hi I have tried to make thise measure, but I get an error message. Is that becouse the revenue is calculated from another measure?

 

Measure = var _Region = MAXX(ALLSELECTED(Center),Center[REGION]
return
calculate([All Members],filter(all(Center),Center[REGION] in _Region

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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