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 am trying to calculate the average number of days late per controller. E.g. Francis' average delay.
I tried to create a calculate column using DIVIDE(Abs(Days Late); No. of audits performed;0) but no. of audits performed is not coming up as a possible denominator. Could this be because "No. of audits" is from a different query?
Could you please help me 🙂 You may see the below snippets for reference
Thanks in advance,
Anne
Solved! Go to Solution.
You could try adding the following calculated column to your "Dates" dataset.
Average number of days late =
VAR __divide =
DIVIDE ( Dates[Days Late]; RELATED ( 'No of audits'[No. of audits preformed] ) )
RETURN
IF (
RELATED ( 'No of audits'[No. of audits preformed] ) = 0;
Dates[Days Late];
__divide
)
If this doesn't produce the correct results, could you give me an example of what output you would expect in the following scenario:
Dates
Controller | Days Late |
John | -500 |
John | -100 |
No of audits
Controller | No of audits |
John | 10 |
Add a calculated column on the "no of audits" dataset.
Average number of days late =
VAR __divide =
DIVIDE ( RELATED ( Dates[Days Late] ); 'No of audits'[No. of audits preformed] )
RETURN
IF (
'No of audits'[No. of audits preformed] = 0;
RELATED ( Dates[Days Late] );
__divide
)
When I enter:
Average number of days late =
Var_divide=
Divide(Related(
No possible columns come up in the related function.
Do you know why this is ?
Thanks
Anne
Do you have a relationship set up between the two datasets?
@Anonymous
Take a look at the sample PBIX file that I've created.
https://1drv.ms/u/s!AnIEh6WhI4Jogr5cTQhBacsSJue5kg?e=lkevpn
@Anonymousthanks so much for your help so far!
There is a one to many relationship between dates and no. of audits - I think this may be why the formula isnt working.
If I create a calculated column in the dates table I can choose columns in the no of audits table but not the other way around , only in this direction.
Please see below snippet for reference.
You could try adding the following calculated column to your "Dates" dataset.
Average number of days late =
VAR __divide =
DIVIDE ( Dates[Days Late]; RELATED ( 'No of audits'[No. of audits preformed] ) )
RETURN
IF (
RELATED ( 'No of audits'[No. of audits preformed] ) = 0;
Dates[Days Late];
__divide
)
If this doesn't produce the correct results, could you give me an example of what output you would expect in the following scenario:
Dates
Controller | Days Late |
John | -500 |
John | -100 |
No of audits
Controller | No of audits |
John | 10 |
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 |
---|---|
14 | |
6 | |
4 | |
3 | |
3 |
User | Count |
---|---|
15 | |
9 | |
6 | |
3 | |
3 |