To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hi, I am a newbie in Power Bi and face a problem in evaluating a column. Please see below sample
Account | Deployment |
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
Solved! Go to Solution.
Hi,
I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.
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] )
Hi,
For a more efficient way here is how to do this with just one measure:
End result (not selecting anything is the case 3.):
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!
Proud to be a Super User!
Hi,
I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.
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] )
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!
User | Count |
---|---|
14 | |
11 | |
6 | |
6 | |
5 |
User | Count |
---|---|
29 | |
17 | |
11 | |
7 | |
5 |