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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
vipett
Helper II
Helper II

Measure sum based on lookup-ed version

I would need a little help, I need to do a measure based on a certain version, the version needs to be looked up based on selected value in a slicer..
 

I have a table roughly like this called 'Standard'

VersionProductMonthAmount
2212A2304100
2301A230450

 

And a table called 'Version'

VersionPreviousPrevious Previous
221222112210
230122122122

 

In my visualization I have a slicer to choose Version and in the matrix I want to show (if I have selected 2301 as the version)

 

ProductMonthCurrent amountPrevious amount
A230450100

 

The current amount is easy, but how do I calculate the previous amount? I tried something like 

Previous Forecast = CALCULATE(SUM(Standard[Amount]),FILTER(Standard,Standard[Version]=RELATED(Version[Previous]))) but it doesn't work..
 
Any ideas?
thanks!
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @vipett ,

You can create a measure as below to get it, please find the details in the attachment.

Previous amount  = 
VAR _previous =
    CALCULATE (
        MAX ( 'Version'[Previous] ),
        FILTER ( 'Version', 'Version'[Version] = SELECTEDVALUE ( 'Standard'[Version] ) )
    )
RETURN
    CALCULATE (
        SUM ( 'Standard'[Amount] ),
        FILTER ( ALL ( 'Standard' ), 'Standard'[Version] = _previous )
    )

vyiruanmsft_0-1688522086595.png

Best Regards

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @vipett ,

You can create a measure as below to get it, please find the details in the attachment.

Previous amount  = 
VAR _previous =
    CALCULATE (
        MAX ( 'Version'[Previous] ),
        FILTER ( 'Version', 'Version'[Version] = SELECTEDVALUE ( 'Standard'[Version] ) )
    )
RETURN
    CALCULATE (
        SUM ( 'Standard'[Amount] ),
        FILTER ( ALL ( 'Standard' ), 'Standard'[Version] = _previous )
    )

vyiruanmsft_0-1688522086595.png

Best Regards

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors