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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
EladAppelNN
Frequent Visitor

Blocking the impact of filters on a measure

Hi

 

Need help with filters applied to DAX

 

When the filter version "Actual" is selected the fomula below works, it returns that last date of actual sales reported

LastActMonth = CALCULATE(max ('fact Sales'[Calendar Day]),'fact Sales'[Version]="Actual")

 

But I must have it working also when the Budget Version is selected in the filter visual

 

Appreciate help on this

kr, Elad

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @EladAppelNN ,

 

You can use the following DAX:

Measure =
MAXX(
 ALLSELECTED('fact Sales'),[Calendar Day])

The Allselected() function calculates based on the data you filter on visual

 

vyangliumsft_0-1697522446221.png

Refer to:

ALLSELECTED function (DAX) - DAX | Microsoft Learn

If the results don't meet your expectations, can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. We can better understand the problem and help you

 

Best Regards,

Liu Yang

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

3 REPLIES 3
Uzi2019
Super User
Super User

Hi @EladAppelNN ,
Try using the below calcultion. I just modified your calculation a little bit.

Uzi2019_0-1697523429002.png

Uzi2019_1-1697523518952.png

 


If I answered your question please give kudos and accept it as a solution!
Thanks

Don't forget to give thumbs up and accept this as a solution if it helped you!!!
Anonymous
Not applicable

Hi  @EladAppelNN ,

 

You can use the following DAX:

Measure =
MAXX(
 ALLSELECTED('fact Sales'),[Calendar Day])

The Allselected() function calculates based on the data you filter on visual

 

vyangliumsft_0-1697522446221.png

Refer to:

ALLSELECTED function (DAX) - DAX | Microsoft Learn

If the results don't meet your expectations, can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. We can better understand the problem and help you

 

Best Regards,

Liu Yang

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

Ritaf1983
Super User
Super User

Hi @EladAppelNN 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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