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
Anonymous
Not applicable

Correct value for Average when filter

mohityash_0-1625647646928.png

I have built above matrix, the value are showing Average of % Completion for each milestone in Phase.
When I apply visual level filter, advance filtering= % Completion is greater than 0, the aggregate value for phase got change which 40 % in above case. Which calculate as:
Sum of %Completion divide by Number of Milestone within a phase.
It should be 40% because we are also counting those milestone within the phase which have 0 % Completion value.
How can I correct it?? below wrong result I'm getting when applying visual level filtering.

mohityash_1-1625648198351.png


thanks in advance!

 

1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

Try the following formula:

 

Measure = 
IF(
    HASONEVALUE('Table'[Milestone]),
    AVERAGE('Table'[%Completion]),
    DIVIDE(
        SUM('Table'[%Completion]),
        COUNTX(
            FILTER(
                ALL('Table'),
                'Table'[Phase] = MAX('Table'[Phase])
            ),
            'Table'[Milestone]
        )
    )
)

image.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

Best Regards,
Winniz

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , share your measure.  In case you measure is using all(Table) use allselected(Table) in place of that

Anonymous
Not applicable

Hi @Anonymous ,

 

Try the following formula:

 

Measure = 
IF(
    HASONEVALUE('Table'[Milestone]),
    AVERAGE('Table'[%Completion]),
    DIVIDE(
        SUM('Table'[%Completion]),
        COUNTX(
            FILTER(
                ALL('Table'),
                'Table'[Phase] = MAX('Table'[Phase])
            ),
            'Table'[Milestone]
        )
    )
)

image.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

Best Regards,
Winniz

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

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.