Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
I have a table that looks something like this:
A company can have 2 managers. They can be the same person, have only one manager, or mix and match managers. I'm currently stuck in a situation where I'm using 2 slicers for each manager column. What I'm trying to figure out is how to have that in one slicer. So the slicer would just be:
Fred
Lisa
Bob
Tim
So if for instance I select Fred, these are the rows and revenue totals that would be returned:
So anywhere where Fred's name appears is what I would be looking for.
This is rather tricky because what I'm also expecting in the end is for the slicer to control everything else on the page. I have other tiles that show how many clients each person manages, what their retention is, etc. and right now I have 2 tables for everything which doesn't help because Fred would have 1 revenue total in one table and 1 revenue total in the other table without a way to sum both of those values to get an overall for Fred. Is this possible to set up?
Solved! Go to Solution.
Hi @Anonymous
There are two approaches I can think of:
ManagersTable =
VAR M1 =
SELECTCOLUMNS ( Table, "Manager", Table[Manager1] )
VAR M2 =
SELECTCOLUMNS ( Table, "Manager", Table[Manager2] )
RETURN
UNION ( M1, M2 )ManagerFilter =
VAR Manager =
SELECTEDVALUE ( ManagersTable[Manager] )
RETURN
IF (
ISFILTERED ( ManagersTable[Manager] ),
CALCULATE ( COUNTA ( Table[Name] ), Table[Manger1] = Manager )
+ CALCULATE ( COUNTA ( Table[Name] ), Table[Manger2] = Manager ),
1 //return 1 if no item in ManagersTable[Manager] column is selected
)
Hi,
Can you please try the below approach of creating two measures instead of two tables ? From my testing it gives proper results as expected. Not sure it will cater all your scenarios. Please let us know.
Relationship
Revenue Manager1 = CALCULATE(SUM(Data[Revenue])) Revenue manager2 = CALCULATE(SUM(Data[Revenue]),USERELATIONSHIP(Manager[Manager],Data[Manager2]) ) Total Revenue = if(ISBLANK([Revenue Manager1]),[Revenue manager2],[Revenue Manager1])
Hi @Anonymous
There are two approaches I can think of:
ManagersTable =
VAR M1 =
SELECTCOLUMNS ( Table, "Manager", Table[Manager1] )
VAR M2 =
SELECTCOLUMNS ( Table, "Manager", Table[Manager2] )
RETURN
UNION ( M1, M2 )ManagerFilter =
VAR Manager =
SELECTEDVALUE ( ManagersTable[Manager] )
RETURN
IF (
ISFILTERED ( ManagersTable[Manager] ),
CALCULATE ( COUNTA ( Table[Name] ), Table[Manger1] = Manager )
+ CALCULATE ( COUNTA ( Table[Name] ), Table[Manger2] = Manager ),
1 //return 1 if no item in ManagersTable[Manager] column is selected
)
@danextian I have everything built but I'm confused on how to apply the measure. Am I applying it to the table and making sure it's set to 1 or 0?
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 46 | |
| 43 | |
| 39 | |
| 19 | |
| 15 |
| User | Count |
|---|---|
| 68 | |
| 67 | |
| 31 | |
| 27 | |
| 24 |