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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
vipett
Helper III
Helper III

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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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