Forum Discussion
DAX Help to Restrict Filtering Column in a table
Hi,
I need a help on DAX, I want to filter the 'Net Available Hours' only based on the 'Resource Region' filter. The 'Billable hours' should not get filtered out. It should remain 112,462 only. Screenshot is below:-
12 Replies
- Greg_Deckler
Community Champion
So, you need to use ALLEXCEPT in that case. Something along the lines of:
CALCULATE(SUM([Billable Hours]),ALLEXCEPT('Table'[Resource Region]))
- Amitkr174
Helper III
Hi - This is not working.
- AnonymousNot applicable
Replacre it with the exact dax
Hi Amit,
It will work if you calculate the measure in the MEASURE 3 itself ,It will not work if you call it from earlier created DAX Measure.
- camargos88
Community Champion
Hi Amitkr174 ,
I believe you need a disconected table for it:
Create a new table using the region values: Region = VALUES('Table'[REGION])
Do not relate it with any table and use it as slicer.
Create your measures:
_1 =VAR _region = VALUES(Region[REGION])RETURN CALCULATE(SUM('Table'[VALUE 1]); 'Table'[REGION] IN _region)_2 = CALCULATE(SUM('Table'[VALUE 2]))If you consider it as a solution, please mark as a solution and kudos.
Ricardo
- Amitkr174
Helper III
Thanks camargos88 for your reply!
Issue is that I using direct query here and I don't have rights to modify a table.
Is there any other way via which this can be resolved?
- camargos88
Community Champion
You don't need to change your source, just remove the relationship in Power BI.
If you want, you can duplicate the region values as table and use this example.
Did I answer your question? Mark my post as a solution!
Ricardo