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.
Hi,
I have created a average function which is as below
"Average = (DISTINCTCOUNT(merged_allocation_daily[Project Sys ID])/(DISTINCTCOUNT(merged_allocation_daily[Crew Sys ID])))"
However the count of project is calculating incorrectly, Below is the screenshot of the matrix created using the formula, the # of projects is coming up incorrect, which should be 347 for HMCA, 316 for HMIN, 215 for HMUK and 755 for HMUS.
Could you please help me in correcting the sum of Projects and Average formula?
Thank you so much!
Ashish
Hi @Ashish9201
Here’s how you can achieve this:
Create a New Measure:
Calculate Crews with 5 or More Projects:
Crew with 5+ Projects = CALCULATE( [Distinct Crew Count], FILTER( ALL(merged_allocation_daily), [Distinct Crew Count] >= 5 ) )
Update Your Visual:
Hi,
I was able to fix the formula and have created below two to resolve the issue.
I am working on to update the visual for crew members to be including in the above visual only if they have worked on 5 or more than 5 projects, when i apply the filter on "# of projects" it only works on the subtotal rather than each line item.
Could you please help me with updating my formulas to including crew members working on 5 or more than 5 projects?
Thank you in advance!
Ashish
Hi Team,
Can someone please help me with solution on updating my formulas to including crew members working on 5 or more than 5 projects?
Thank you,
Ashish Gupta
Hi @Ashish9201
To correct the calculation of the number of items, you need to make sure that you are using the correct columns in the DISTINCTCOUNT function. It appears that the problem may be related to the way you are calculating the different item IDs.
Modify your fomula like below:
Average =
VAR TotalProjects =
DISTINCTCOUNT ( merged_allocation_daily[Project Sys ID] )
VAR TotalCrews =
DISTINCTCOUNT ( merged_allocation_daily[Crew Sys ID] )
RETURN
DIVIDE ( TotalProjects, TotalCrews, 0 )
Best Regards,
Adamk Kong
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Ashish9201 , Try a measure like
Sumx(Values(merged_allocation_daily[Crew Company]), calculate(DISTINCTCOUNT(merged_allocation_daily[Crew Sys ID]) ))
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 |
---|---|
111 | |
101 | |
76 | |
64 | |
63 |
User | Count |
---|---|
141 | |
105 | |
101 | |
80 | |
67 |