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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Kev_G
Regular Visitor

I need help to display sorted accounts in a table that has unique values

Hi, I would like to ask for help in Power Bi to evaluate a column. Please see below sample

 

AccountDeployment
Company1    WFH
Company1    Office
Company2    WFH
Company3    Office
Company 4WFH
Company 5Office

 

I'd like to create a table that I can use for the Slicer Visual:

1. Showing the accounts that have WFH Deployment only

2. Showing the accounts that have Office Deployment only

3. Showing the accounts that have both Office and WFH deployment

Thank you!

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

Hi, @Kev_G ;

You could create a flag measure.

1.create a table as slicer.

slicer = VALUES('Table'[Deployment])

2.create a flag measure.

flag = 
var _contain=SUMMARIZE(FILTER(ALL('Table'),[Deployment] in ALLSELECTED('slicer'[Deployment])),[Account])
var _not=SUMMARIZE(FILTER(ALL('Table'),NOT( [Deployment]) in ALLSELECTED('slicer'[Deployment])),[Account])
return IF( ISFILTERED(slicer[Deployment]),
         IF(
           DISTINCTCOUNT(slicer[Deployment])=CALCULATE(DISTINCTCOUNT(slicer[Deployment]),ALL(slicer)),
            IF(CALCULATE(DISTINCTCOUNT('Table'[Deployment]),ALLEXCEPT('Table','Table'[Account]))=DISTINCTCOUNT(slicer[Deployment]),1,0), 
             IF(MAX('Table'[Account]) in EXCEPT( _contain ,_not),1,0)),1)

3.apply it into filter.

vyalanwumsft_0-1645496576046.png

The final output is shown below:

vyalanwumsft_1-1645496600743.png  vyalanwumsft_2-1645496606409.png vyalanwumsft_3-1645496612147.png

 

 


Best Regards,
Community Support Team_ Yalan Wu
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

2 REPLIES 2
v-yalanwu-msft
Community Support
Community Support

Hi, @Kev_G ;

You could create a flag measure.

1.create a table as slicer.

slicer = VALUES('Table'[Deployment])

2.create a flag measure.

flag = 
var _contain=SUMMARIZE(FILTER(ALL('Table'),[Deployment] in ALLSELECTED('slicer'[Deployment])),[Account])
var _not=SUMMARIZE(FILTER(ALL('Table'),NOT( [Deployment]) in ALLSELECTED('slicer'[Deployment])),[Account])
return IF( ISFILTERED(slicer[Deployment]),
         IF(
           DISTINCTCOUNT(slicer[Deployment])=CALCULATE(DISTINCTCOUNT(slicer[Deployment]),ALL(slicer)),
            IF(CALCULATE(DISTINCTCOUNT('Table'[Deployment]),ALLEXCEPT('Table','Table'[Account]))=DISTINCTCOUNT(slicer[Deployment]),1,0), 
             IF(MAX('Table'[Account]) in EXCEPT( _contain ,_not),1,0)),1)

3.apply it into filter.

vyalanwumsft_0-1645496576046.png

The final output is shown below:

vyalanwumsft_1-1645496600743.png  vyalanwumsft_2-1645496606409.png vyalanwumsft_3-1645496612147.png

 

 


Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

tamerj1
Super User
Super User

Hi @Kev_G 

Easier to start with adding a new calculated column to you existing table (Accounts Table). 

Number Of Deployments=

COUNTROWS (
FILTER ( Accounts, Accounts[Account] = EARLIER ( Accounts[Account] ) )
)

 

Then create your tables 

Table 1 =
FILTER (
Accounts,
Accounts[Deployment] = "WFH"
&& Accounts[Number Of Deployments] = 1
)

 

Table 2 =
FILTER (
Accounts,
Accounts[Deployment] = "Office"
&& Accounts[Number Of Deployments] = 1
)

 

Table 3 =
FILTER (
Accounts,
Accounts[Number Of Deployments] = 2
)

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

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.