Forum Discussion

deboec's avatar
deboec
Icon for Helper I rankHelper I
4 years ago
Solved

Filter context for matrix visual total

Hi,   I use a matrix visual to visualize a multi-level contribution margin system for different projects. Example: The measure for the recruitments ("Rekrutierungen") in row 3 is a simple: ...
  • v-chenwuz-msft's avatar
    4 years ago

    Hi deboec ,

     

     

    Is that, the total value is incorrect ,but the Feb or Mar is right?

    You can consider to use the function HASONEVALUE(<columnName>) to calculate the total. 

    How to use Hasonevalue() 

    Kosten pro Rekrutierung =
    VAR KostenRekrutierung =
        IF(
            ISBLANK( [Rekrutierungen] ),
            BLANK(),
            CALCULATE(
                SUMX(
                    FILTER(
                        ALL( Kostenstellen ),
                        Kostenstellen[Kostenstelle] = 3630
                            || Kostenstellen[Kostenstelle] = 3640
                            || Kostenstellen[Kostenstelle] = 7110
                    ),
                    [Kosten]
                )
            )
        )
    VAR AnzahlRekrutierungen =
        CALCULATE( [Rekrutierungen], ALL( Kostenstellen[Kostenstelle] ) )
    VAR Result =
        ABS( KostenRekrutierung / AnzahlRekrutierungen ) 
    VAR _total = calculate(sum(),FILTER(ALL(),  )) // depend on your table fields to calculate all values
    RETURN
        IF( HASONEVALUE( Date[month] ), Result, _total )
    

     

    if you it does not work , please share your pbix file without sensitive data.

     

    Best Regards

    Community Support Team _ chenwu zhu

     

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