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
masplin
Impactful Individual
Impactful Individual

Struggling to get ALL to ALL!!!

I have this measure which calcuates the average % Call/Available time for each adviser by the vlaue of each day 

 

AVG % Call/Available = AVERAGEX(ADDCOLUMNS(SUMMARIZE(AdviserRole,
                                                     AdviserRole[AdviserId],
                                                      'Date'[Date]),                   
                                                     "PctCall", [% Call/Available Time]
                                                    ),
                                                    [PctCall])

 

I want to calculate what the value is for all advisers over previous 3 months to use as a KPI

% Call/Available High = 
VAR
MaxDate=MAX('Date'[Date])
RETURN

CALCULATE([AVG % Call/Available],    DATESINPERIOD('Date'[Date],MaxDate,-3,MONTH),ALLSELECTED(AdviserRole[AdviserId]))

I have tried numerous versions of ALL and al lproduce the same result

I have the date slicer as 1/9 to 18/9 so the datesin period is working as for each adviser it is calculating last 3 months. However I'm trying to get each row to show 47% which is the average over everyone selected. I've tried ALL(AdviserRole)

 

Capture.PNG

I've done this in the past and just can't figure why this doens't just work?

 

Any help appreicate as sure it trivial

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@masplin 

Can you replace ID with Name as below?

% Call/Available High = 
VAR
MaxDate=MAX('Date'[Date])
RETURN

CALCULATE([AVG % Call/Available],    DATESINPERIOD('Date'[Date],MaxDate,-3,MONTH),ALLSELECTED(AdviserRole[Name]))

 

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

3 REPLIES 3
Fowmy
Super User
Super User

@masplin 

Can you replace ID with Name as below?

% Call/Available High = 
VAR
MaxDate=MAX('Date'[Date])
RETURN

CALCULATE([AVG % Call/Available],    DATESINPERIOD('Date'[Date],MaxDate,-3,MONTH),ALLSELECTED(AdviserRole[Name]))

 

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

masplin
Impactful Individual
Impactful Individual

Ok that works!!!  Dont quite understand why as AdviserID and Name are columns on same talbe and each is unique to a user. 

 

Is this because [Name] is the field used in the SUMMARIZE expression?

 

Thanks a lot

masplin
Impactful Individual
Impactful Individual

Problem is its producing a result even for names who have not been selcted by the team and userrole slicers. I was expecting blanks since there names are selected?

Capture.PNG

 

 

I tried this but it doesnt do anything

 

CALCULATE([AVG % Call/Available],    DATESINPERIOD('Date'[Date],MaxDate,-3,MONTH),ALLSELECTED(PhoneUser[Name]),ALLSELECTED(Team[Team]),ALLSELECTED((AdviserRole[UserRole])))

 

Phoneuser and Adviserrole are interchangeable as long as I use the same in both measures and on the table. 

 

If I take the meausr eout I just have names in that team and userrole

 

Capture.PNG

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.