Forum Discussion

Marfoss's avatar
Marfoss
Regular Visitor
3 years ago

Dax query

I need help with the below DAX query 

 

I have the below formula which counts rows in a table while applying filters but ignoring some others i.e AMR Merged'[Week number] && AMR Merged'[Last week]

 

**************

 

Break down 510/041P_/02900/00010 count 12 months =
CALCULATE (
COUNTROWS ( 'AMR Merged' ),
'AMR Merged'[Functional loc. - TRIM] = "510/041P_/02900/00010"
&& 'AMR Merged'[< 12 months ago malfunction] = "Yes",
ALL ( 'AMR Merged'[Week number], 'AMR Merged'[Last week] )
)

 

I tried to create a similar calculation for a sum in the same table but the code doesn’t seem to work - can someone advise where i'm going wrong?

 

Break down 510/041P_/02900/00010 sum 12 months = CALCULATE(SUMX('AMR Merged') , 'AMR Merged'[Functional loc. - TRIM] = "510/041P_/02900/00010" && 'AMR Merged'[< 12 months ago malfunction] = "Yes" , 'AMR Merged'[Notification_EUSAP.Breakdown dur.])) , ALL('AMR Merged'[Week number] , 'AMR Merged'[Last week]))

1 Reply