Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Anonymous
Not applicable

Context in dax measure

Hello to all,

I have a problem with my filter. When I filter on a category, I should have only three people concerned. It works well if in my table I use their own fields. The problem is that when I add fields calculated from measurements in my table, the context of the filter disappears.

In the picture, the top table shows the expected result. It works because I did not add my measure. When I add my measure, the filter by category does not work anymore. I imagine that the ALLEXCEPT function can help me but I can't place it in my measure.

1 Cumulative Buyer/Appro STD = if(CALCULATE([Number of purchases],FILTER('NOHA PURCHASES','NOHA PURCHASES'[Buyer (order)]="X"), FILTER('NOHA CFO','NOHA CFO'[Approval WF Standard]="X"))>=1, "CUMULARITY DECREASED", "CLEAR")

If someone knows how to help me I thank him/her greatly.

 

 

image.png

1 ACCEPTED SOLUTION
V-pazhen-msft
Community Support
Community Support

@Anonymous 
You can add the Allexcept() function in the bold part but you should use Filter(All(table), [Category]=MAX([Category]). So try:

 

1 Cumulative Buyer/Appro STD = if(CALCULATE([Number of purchases],FILTER('NOHA PURCHASES','NOHA PURCHASES'[Buyer (order)]="X"), FILTER('NOHA CFO','NOHA CFO'[Approval WF Standard]="X"), Filter(All('Tablename'),[Category]=MAX([Category])))>=1, "CUMULARITY DECREASED", "CLEAR")

 


Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
V-pazhen-msft
Community Support
Community Support

@Anonymous 
You can add the Allexcept() function in the bold part but you should use Filter(All(table), [Category]=MAX([Category]). So try:

 

1 Cumulative Buyer/Appro STD = if(CALCULATE([Number of purchases],FILTER('NOHA PURCHASES','NOHA PURCHASES'[Buyer (order)]="X"), FILTER('NOHA CFO','NOHA CFO'[Approval WF Standard]="X"), Filter(All('Tablename'),[Category]=MAX([Category])))>=1, "CUMULARITY DECREASED", "CLEAR")

 


Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

lbendlin
Super User
Super User

Did you see that they simplified the behavior of the CALCULATE() command for scenarios like yours?

 

Specifying multiple filter conditions in CALCULATE - SQLBI

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

Check out the August 2024 Power BI update to learn about new features.

August Carousel

Fabric Community Update - August 2024

Find out what's new and trending in the Fabric Community.