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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
vlsantos
Regular Visitor

behavior of measures written in various forms

Hello forum, today I come to ask a curiosity when I'm writing some measurements, related to time. This measurement that I will add as an example is used to calculate a field in the month prior to the one selected in the filter (2023-12-01). My question is the following, why out of these 3 options, only one of them returns value?

vlsantos_0-1712171073378.png

vlsantos_1-1712171130929.pngvlsantos_2-1712171196841.png

 

 

1 ACCEPTED SOLUTION
v-zhengdxu-msft
Community Support
Community Support

Hi @vlsantos 

 

Just as @StrategicSavvy said that, in case of 3rd one only the innermost filter get into consideration.

 

When the Calculate function is used in nesting, the order of action is from the outermost layer to the innermost layer, if the inner filter condition is in the same column as the outer filter condition and conflicts with it, the inner filter overrides the outer filter condition;

You can also use the keepfilters function to change the mechanism of Calculate's filter conditions, instead of directly overriding the original filter context, you can add new conditions based on the original context, resulting in the intersection of multiple conditions.

 

This link can help you:

CALCULATE'S NESTED USAGE

 

Best Regards

Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-zhengdxu-msft
Community Support
Community Support

Hi @vlsantos 

 

Just as @StrategicSavvy said that, in case of 3rd one only the innermost filter get into consideration.

 

When the Calculate function is used in nesting, the order of action is from the outermost layer to the innermost layer, if the inner filter condition is in the same column as the outer filter condition and conflicts with it, the inner filter overrides the outer filter condition;

You can also use the keepfilters function to change the mechanism of Calculate's filter conditions, instead of directly overriding the original filter context, you can add new conditions based on the original context, resulting in the intersection of multiple conditions.

 

This link can help you:

CALCULATE'S NESTED USAGE

 

Best Regards

Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

StrategicSavvy
Resolver II
Resolver II

Hi @vlsantos 

In case of 1st and 2nd filters get overwritten . In case of 3rd one only the innermost filter get into consideration. 

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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