Forum Discussion
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
- Greg_DecklerCommunity Champion
Marfoss Maybe try using SUM versus SUMX. Otherwise, Sorry, having trouble following, can you post sample data as text and expected output?
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882
Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.