Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Error in Grand Total, Selected Value Returning Wrong Total when 'Select ALL' is Clicked

Hi everyone, I need help in resolving multiple problems in my power BI visual.    The objective of the visual is to perform a comparative analysis for the actual cost of the Project with the origin...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Anonymous ,

    Based on the information you have provided, the issue with metrics not being updated correctly appears to be related to how the function is interpreted in the slicer context. Please consider modifying all filters in the metrics clearing table except for the filters to be retained:

    Distribution X =
    VAR TotalMV =
        CALCULATE (
            COUNTROWS ( 'Project Matching' ),
            ALL ( 'Project Matching'[MV.Vendor Name] )
        )
    VAR SelectedMV =
        COUNTROWS (
            ALLEXCEPT (
                'Project Matching',
                'Project Matching'[Project Name],
                'Project Matching'[State],
                'Project Matching'[Vendor]
            )
        )
    RETURN
        IF ( TotalMV = SelectedMV, TotalMV, SelectedMV )
    


    The issue of totals not being aggregated correctly is a common problem in Power BI, especially when working with complex calculations that need to be aggregated in different ways at the total level. You can use this function on a table that follows the current filter context and then perform row-level calculations in that context:

    NR Cost =
    SUMX (
        VALUES ( 'Project Matching'[Project Name] ),
        VAR mv_rate = [MV Rate] * [Hrs_Alloc]
        RETURN
            IF (
                ISBLANK ( mv_rate )
                    || mv_rate = 0,
                [Cost W Inflation] / [Distribution X],
                mv_rate
            )
    )
    

     

    How to Get Your Question Answered Quickly - Microsoft Fabric Community

    If it does not help, please provide more details with your desired out put and pbix file without privacy information.

     

    Best Regards,

    Ada Wang

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