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.
Hello,
I have to be missing something silly here. I can't find anything online or in the boards that fits my specific quirk.
I have a dashboard that show's a salesman's metrics for his territory. Since this report can be printed for them to hand off it needs to display their name. A sales manager doesn't have a territory assigned so he can see everyone's information.
What I'm trying to do is an if statement that determines if 1 salesman is selected (since each guy can only see their information) to show that name. If more than one is selected (like when the sales manager is looking at all territories) it shows his name.
My logic is...
If NumberOfSelectedSalesman > 1
Show Sales Manager,
Show Salesman
This is my code. It counts all 5 salesmen no matter the filter selection, so it always shows the sales manager. Thoughts?
SelectedSalesman =
VAR SelectedSalesman =
VALUES ( Table[SalesmanName] )
VAR NumberOfSelectedSalesman =
CALCULATE ( COUNTROWS ( SelectedSalesman ) )
RETURN
NumberOfSelectedSalesman // Used for troubleshooting, shows 5 salesmen selected
& IF (
NumberOfSelectedSalesman > 1,
"Sales Manager",
Table[SalesmanName]
)
Solved! Go to Solution.
Well, my life got easier all of a sudden. This requirement is no longer needed. Thank you though!
Sure thing, sorry.
VARs
Salesman Table
Hi @mjohnsonsmi,
Try this code:
_Salesman =
VAR selected = ALLSELECTED(Table1[Salesman])
VAR returnValue = IF(COUNTROWS(selected) > 1; "Sales Manager"; DISTINCT(Table1[Salesman]))
RETURN
returnValue
Ricardo
Thank you Ricardo, unfortunately it's doing the same behavior. It only shows the sales manager no matter what's selected. I had to change the semicolons in the IF to commas also (for anyone reading this).
Something I forgot to mention, the salesman field that does the filtering has many records in the table. Sales records with the owner (salesman) indicated, although there are only the 5 distinct salesman names.
Hi @mjohnsonsmi.
Can u provide a print of your screen, with your visual and slicers (current and what u want) ?
Ricardo
Well, my life got easier all of a sudden. This requirement is no longer needed. Thank you though!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
99 | |
75 | |
73 | |
49 |
User | Count |
---|---|
145 | |
109 | |
109 | |
90 | |
64 |