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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
jayjay0306
Helper III
Helper III

Power BI filter - Latest forecast version

Hi people,
I am in a bit of a puzzle here and hope you guys can help:
I have the following table showing our forecast version:

picture1.PNG

Our forecast process works in the following way:
On the first day, each month, we get a new "SOP Version" and "LAG 1". After some days the "latest" LAG-version changes from "LAG 1" to "LAG 0" for the rest of the month.

 

Example in table: Latest "SOP Version"=SOP5. From "day 1" to fx. "day 4" the table will be loaded with "LAG 1" only. On "day 5" the table will be enriched with "LAG 0".

 

Now, what I want to make is a dynamic filter, which always filters the latest "SOP" and "LAG"-version on the Power BI report I have.

 

I have managed to make a summarized table in Power BI filtering the "lowest" LAG value for each SOP-version:

 

 

 

SOP&LAG (Latest Vers) = SUMMARIZE('Forecast';'Forecast'[SOP Version];"LAG (lowest value)";MINX('Forecast';'Forecast'[LAG]))

 

 

 

But I can't figure out to isolate the the latest SOP Version (SOP5) with its latest LAG-version (LAG0).

I am not even sure this is the right approach?

 

All ideas will be greatly appreciated.
Thanks.
Br,
Jakob

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

Hi @jayjay0306 ,

 

You could share your expected result here with image or table.

And you could try the following DAX:

Table 2 =
SUMMARIZE (
    'Forecast',
    'Forecast'[SOP Version],
    "LAG (lowest value)", CALCULATE (
        SELECTEDVALUE ( Forecast[LAG] ),
        FILTER (
            Forecast,
            RIGHT ( Forecast[LAG], 1 ) = MINX ( Forecast, RIGHT ( Forecast[LAG], 1 ) )
        )
    )
)

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

3 REPLIES 3
v-eachen-msft
Community Support
Community Support

Hi @jayjay0306 ,

 

You could share your expected result here with image or table.

And you could try the following DAX:

Table 2 =
SUMMARIZE (
    'Forecast',
    'Forecast'[SOP Version],
    "LAG (lowest value)", CALCULATE (
        SELECTEDVALUE ( Forecast[LAG] ),
        FILTER (
            Forecast,
            RIGHT ( Forecast[LAG], 1 ) = MINX ( Forecast, RIGHT ( Forecast[LAG], 1 ) )
        )
    )
)

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

thanks v-eachen-msft, it got me the rest of the way 🙂

Br,

JayJay0306

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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