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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
George1973
Helper V
Helper V

Values Contingency from the last non blank position

Hi All,

I have a table, where produtcs codes are given besides relevant YTD Costs.

 

George1973_0-1702041086120.png

COGS per Unit = AVERAGE(COGS[COGS])

 

The values are beeing calculated with a very simple measure, given above. COGS tables is related to main Date Table and Producs Table.

I would like to have kind of "Data Contingency", where all the blank spaces in the Matrix given above will be filled out by the "non blank" values from the previous year. Like given below in some exempary layouts:

George1973_1-1702041402292.png

 

Thanks in advance,

Please feel free to ask quetions regarding  possible clarifications from my side.

1 REPLY 1
Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your semantic model looks like, but please check the below picture and the attached pbix file.

I hope the below can provide some ideas on how to step further to get a solution for your semantic model.

Jihwan_Kim_1-1702185965314.png

 

 

Jihwan_Kim_0-1702185937175.png

 

 

Expected result measure: =
VAR _t =
    FILTER (
        ADDCOLUMNS (
            CALCULATETABLE (
                SUMMARIZE ( COGS, 'Product'[Product], 'Calendar'[Year] ),
                'Calendar'[Year] <= MAX ( 'Calendar'[Year] )
            ),
            "avg", [COGS avg:]
        ),
        [avg] <> BLANK ()
    )
RETURN
    CALCULATE ( [COGS avg:], INDEX ( 1, _t, ORDERBY ( 'Calendar'[Year], DESC ) ) )

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.