Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
redhughes
Helper II
Helper II

Help with a measure

Hi,

 

I was wondering if someone could help me solve a problem.

 

The data I have looks like this:

 

PowerBI_001.PNG

 

What I want to achieve is a table that shows how many visits each client had, how many distinct employees worked for the client, and an 'distinct employee-to-visits' ratio. Then, ideally there would be a row or another visual that states how many clients' ratio was below our target (let's say 0.428).

 

So far I've got:

 

 

NoOfVisits = count(Sheet1[Date])

 

DistinctEmployees = DISTINCTCOUNT(Sheet1[Employee])
EmployeesToVisitsRatio = ROUNDDOWN([DistinctEmployees]/[NoOfVisits],2)

And the table looks like this:

 

PowerBI_002.PNG

Ideally the solution would enable filtering on week, so it would tell me that in week 1 we had x number of clients hitting the target and in week 2, y number of clients.

 

Any suggestions? Thank you in advance!

 

1 ACCEPTED SOLUTION
v-ljerr-msft
Employee
Employee

Hi @redhughes,


 Then, ideally there would be a row or another visual that states how many clients' ratio was below our target (let's say 0.428).

If I understand it correctly, you should be able to use the formula below to create a new measure to calculate how many clients' ratio was below the target(0.428). Smiley Happy

Measure =
SUMX (
    SUMMARIZE (
        Sheet1,
        Sheet1[Client],
        "abc", IF ( [EmployeesToVisitsRatio] < 0.428, 1, 0 )
    ),
    [abc]
)

r5.PNG

 

Regards

View solution in original post

5 REPLIES 5
v-ljerr-msft
Employee
Employee

Hi @redhughes,


 Then, ideally there would be a row or another visual that states how many clients' ratio was below our target (let's say 0.428).

If I understand it correctly, you should be able to use the formula below to create a new measure to calculate how many clients' ratio was below the target(0.428). Smiley Happy

Measure =
SUMX (
    SUMMARIZE (
        Sheet1,
        Sheet1[Client],
        "abc", IF ( [EmployeesToVisitsRatio] < 0.428, 1, 0 )
    ),
    [abc]
)

r5.PNG

 

Regards

worked like a dream, thank you so much!!

I will have a go with this after xmas - many thanks!

Greg_Deckler
Super User
Super User

Add a Slicer visualization based upon Week column?


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

I'm mainly after another measure/way of showing count of clients with the ratio below a certain level. Is the slicer going to achieve this?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.