Forum Discussion
Filter context for matrix visual total
- 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.
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.
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.
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.