multiple filters
4 TopicsConditional SUM
I used the following DAX to return total "Approved" amounts across all datanameshorts in my dfact table. When datanameshort is either "SBG" or "SBG10" the total of "Approved" and "Paid" amounts must be returned instead. As datanameshort is a column I needed to use selectedvalue to get a single value out of all values in the column and looks like that makes the condition to be always False (only else part gets executed) ApprovedAmount = IF ( CONTAINSSTRING(SELECTEDVALUE(DFACT[DATANAMESHORT]), "SBG"), CALCULATE(SUM(DFACT[AMOUNT]), FILTER(DFACT, CONTAINSSTRING(DFACT[DATANAMESHORT],"SBG") && DFACT[STATUS] IN {"Approved","Paid"} && DFACT[GEONAME] <> BLANK())), CALCULATE(SUM(DFACT[AMOUNT]), FILTER(DFACT, DFACT[STATUS] = "Approved"))) Does anyone have any idea how to fix this. a screenshot of the dfact table is addedSolved3.6KViews0likes4CommentsSecond Filter criteria do not work
Hi, following DAX expression do not filter rows match second critatia i.e. Table_A[Email] not ContainString "XYZ". I can see rows conting XYZ in table. What's worng! tblFilterData = FILTER( CALCULATETABLE ( Table_A, RELATEDTABLE(Table_B) ), not (CONTAINSSTRING(Table_A[Email],"ABC") && not (CONTAINSSTRING(Table_A[Email],"XYZ")) ) Regards AtifSolved528Views0likes1CommentCalculate with multiple filters
Hi everyone, I am trying to calculate a percentage here by using the CALCULATE function with multiple filters. Here is the dax code that I have written. This measure works as it should, but it takes time to load. I am wondering if there is another way of writing the DAX for better performance? % of hires within 15 workdays = VAR NoHiresWithin15WorkDays = CALCULATE(countrows(filter(Request,Request[Hired within 15 Workdays]="Yes")),FILTER(REQUEST, Request[AcceptanceDt]<>BLANK() && [Candidate Confirmed Date]<>BLANK() && Request[RPI2 - DateFlag by RequestID]=tRUE() && [Feedback Workdays by requestID]<=5)) var requestidcount = CALCULATE(COUNT(Request[RequestID]), FILTER(REQUEST, Request[AcceptanceDt]<>BLANK() && [Candidate Confirmed Date]<>BLANK() && Request[RPI2 - DateFlag by RequestID]=tRUE() && [Feedback Workdays by requestID]<=5)) RETURN NoHiresWithin15WorkDays/requestidcount Thank you in advance!Solved983Views0likes1CommentManage Roles with Multiple Filters
Hi, I need to filter my table by using the managing roles. When I try to use the DAX command in a calculated column, it works perfectly fine. However, in my manage roles the DAX is not working. Basically, I want to filter the Brand = "DEF" with their ItemId that Ends with "G". In manage roles, the brand wouldn't even show up in the report when role testing conducted. Here is my DAX command for the calculated column IF([Brand]="ABC" || AND([Brand]="DEF",RIGHT([ItemId],1)="G"),TRUE(),FALSE()) DAX command for manage role [Brand] in {"ABC"} || AND([Brand]="DEF",RIGHT([ItemId],1)="G")Solved6.1KViews0likes3Comments