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
rrb555
New Member

Help in Displaying Accounts Column that has only one unique value

Hi, I am a newbie in Power Bi and face a problem in evaluating a column. Please see below sample

 

AccountDeployment
Company1    WFH
Company1    Office
Company2    WFH
Company3    Office

 

I'd like to create 3 new column/measure 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

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.

 

Picture1.png

Deployment measure: =
VAR newtable =
SUMMARIZE (
ADDCOLUMNS (
VALUES ( Data[Account] ),
"@result",
CALCULATE (
SWITCH (
SELECTEDVALUE ( Slicer[Index], 3 ),
1,
CALCULATE (
SELECTEDVALUE ( Data[Account] ),
Data[Deployment] = "WFH"
&& DISTINCTCOUNT ( Data[Deployment] ) = 1
),
2,
CALCULATE (
SELECTEDVALUE ( Data[Account] ),
Data[Deployment] = "Office"
&& DISTINCTCOUNT ( Data[Deployment] ) = 1
),
3,
CALCULATE (
SELECTEDVALUE ( Data[Account] ),
Data[Deployment]
IN { "WFH", "Office" }
&& DISTINCTCOUNT ( Data[Deployment] ) = 2
)
)
)
),
[@result]
)
RETURN
CONCATENATEX ( newtable, [@result] )

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

3 REPLIES 3
ValtteriN
Super User
Super User

Hi,

For a more efficient way here is how to do this with just one measure:

WFH slicer = IF(
or(CONTAINSSTRING(max('WFH+office'[Deployment]),MAX(WFHslicer[Value])),
NOT(ISFILTERED(WFHslicer[Value]))),1,0)
(Slicer Table) 
WFHslicer = {("Office"),("WFH")}

Apply the measue in a visual.
ValtteriN_0-1644743085293.png



End result (not selecting anything is the case 3.):

ValtteriN_1-1644743127122.png

 

ValtteriN_2-1644743141553.png

 

I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/






Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.

 

Picture1.png

Deployment measure: =
VAR newtable =
SUMMARIZE (
ADDCOLUMNS (
VALUES ( Data[Account] ),
"@result",
CALCULATE (
SWITCH (
SELECTEDVALUE ( Slicer[Index], 3 ),
1,
CALCULATE (
SELECTEDVALUE ( Data[Account] ),
Data[Deployment] = "WFH"
&& DISTINCTCOUNT ( Data[Deployment] ) = 1
),
2,
CALCULATE (
SELECTEDVALUE ( Data[Account] ),
Data[Deployment] = "Office"
&& DISTINCTCOUNT ( Data[Deployment] ) = 1
),
3,
CALCULATE (
SELECTEDVALUE ( Data[Account] ),
Data[Deployment]
IN { "WFH", "Office" }
&& DISTINCTCOUNT ( Data[Deployment] ) = 2
)
)
)
),
[@result]
)
RETURN
CONCATENATEX ( newtable, [@result] )

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Hi Jihwan, 

 

I appreciate your solution on this. I just want to ask if is it possible to use a table instead of a card for the list of accounts? I have more accounts to display and I also want my report to be interactive.

 

Thank you!

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.