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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Rena
Resolver II
Resolver II

Creating a measure that is the value of another measure but ignores a filter

This is what I have.

Rena_0-1772548903150.png

Rena_3-1772549158857.png

 

Basically - you put in a date and it will tell you the yield for a specific line, component, whatever for the past 52 weeks and then for however many weeks have been completed past that date.  The cards on the right are the correct summaries.

The charts work because I have a filter applied to them based on two measures (Yield Past and Yield Future)

Rena_1-1772549001764.png

 

What I am trying to do is use the Yield % PO - Past as a constant line in the bottom chart (future) as the baseline for improvement.

The problem I have is that the bottom chart is filtered by Yield Future =1 which is not allowing the constant line to have a value because it is allowing no dates.

Rena_2-1772549101582.png

How can I write a measure that will ignore the yield future filter (I tried CALCULATE with ALL but Yield Future can't be selected)?

 

 

1 ACCEPTED SOLUTION

I got it!

Rena_1-1772557889660.png

@collinq - Thank you so much.  I wouldn't have been in the right realm without your help!

View solution in original post

5 REPLIES 5
Murtaza_Ghafoor
Continued Contributor
Continued Contributor

@Rena 
Problem:

Measures are not columns, when you use all(measures) it will not work.

 

Proposed Solution:

You can try to rewrite your baseline measure like this:

Baseline Past Yield =
CALCULATE(
    [Yield % PO - Past],
    REMOVEFILTERS('Date')
)

OR

Baseline Past Yield =
CALCULATE(
    [Yield % PO - Past],
    ALL('Date')
)

 

If this helps, Mark as Kudos | Mark as Solution| Help Others

collinq
Super User
Super User

Hi @Rena  ,

Measures are not "filterable" in filter context like other fields.  So, you cant really ignore it.   since the visual is being filtered by dates your constant line measure needs to ignore the visual date context and compute the past baseline using the Start Date.

If I understand correctly you want this:  On the Future chart (which is filtered to “future weeks”), you want a constant line equal to Yield % PO – Past (the “past 52 weeks baseline”), regardless of which week is on the x-axis.

I looked it up and found some helpful code:

Yield Baseline (Past 52W Constant) :=
VAR StartDate =
    SELECTEDVALUE ( 'Fiscal Map'[Date] )
VAR PastStart =
    StartDate - 364
RETURN
CALCULATE (
    [Yield % PO],  -- or your base yield measure (not the past/future flag)
    REMOVEFILTERS ( 'Fiscal Map'[Date] ),             -- ignore the chart's date filter
    FILTER (
        ALL ( 'Fiscal Map'[Date] ),                   -- rebuild the past period
        'Fiscal Map'[Date] > PastStart
            && 'Fiscal Map'[Date] <= StartDate
    )
)


Let us know how that works!

 




Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!
Private message me for consulting or training needs.




Thanks for the input.  I built the measure as stated above and placed it as the constant line in both charts.  

Top chart is filtered to only show past dates

Bottom chart is filtered to only show future dates

The constant line becomes the values of the past or future.

Rena_0-1772556913033.png

 

I am thinking of adding a second date table and putting a synced slicer to it that is all white and at the back so it can't be changed but automatically matches the selected date and using it as I can't figure out why removing the filter isn't over-writing the filter

 

People smarter than me probably already knew that wouldn't work and why but I didn't.  So I tried making a second date table and removing filters to the first date table, then I tried removing filters to the date column in the yield table I am using and both times I got the same result.  When I use the measure as the constant line nothing shows up.

Rena_0-1772557704443.png

 

I got it!

Rena_1-1772557889660.png

@collinq - Thank you so much.  I wouldn't have been in the right realm without your help!

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.