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.
all,
Im having troubles with a measure determining the amount of sales reps that are under target for a specific selection in a certain period.
I have a fact table sales and a fact table targets, both connected by the sales rep dimension table and the datetable, I wish to count the amount of Sales reps that are under target in the selected period, or other filters (that apply to both fact tables).
is there a way to calculate this?
Solved! Go to Solution.
Try:
Sales rep under target =
SUMX (
dimSalesRep,
COUNTROWS (
FILTER ( dimSalesRep, SUM ( Sales[Amount] ) < SUM ( Target[Amount] ) )
)
)
or
Sales rep under target =
COUNTX (
FILTER ( dimSalesRep, SUM ( Sales[Amount] ) < SUM ( Target[Amount] ) ),
dimSalesRep[Sales rep]
)
Proud to be a Super User!
Paul on Linkedin.
You probably have two base measures like this :
Target_Amount = SUM( Target[Amount] )
Sales_Amount = SUM( Sales[Amount] )
Now what you can do is loop over each Rep and for each, calculate the two measures and only count those where
[Target_Amount] < [Sales_Amount]
Count_Rep_No_Target =
COUNTROWS(
FILTER(
SalesRep,
[Target_Amount] < [Sales_Amount]
)
)
Tell me if it works 😛
seems to work, but the total is not working because on total it is above target, so the total is 0. I want to put this in a kpi card so then the count is not properly displayed
Can you share with me a visual where the measure works and the one that don't works
You see my page here:
i already created a blank correction in my measure by doing this:
Try:
Sales rep under target =
SUMX (
dimSalesRep,
COUNTROWS (
FILTER ( dimSalesRep, SUM ( Sales[Amount] ) < SUM ( Target[Amount] ) )
)
)
or
Sales rep under target =
COUNTX (
FILTER ( dimSalesRep, SUM ( Sales[Amount] ) < SUM ( Target[Amount] ) ),
dimSalesRep[Sales rep]
)
Proud to be a Super User!
Paul on Linkedin.
Ha I see,
You'll need to use the two measures inside the FILTER statement.
Using SUM( ... ) won't work as It won't trigger Context transition for each Sales Rep.
Create 2 measues (One for target and one for Sales like I did)
So you want to count the number of Sales Rep that did not achieve their target?
correct!
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 |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
101 | |
86 | |
64 |