cancel
Showing results for
Did you mean:

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Anonymous
Not applicable

## Measure to get value from right column with value

Hi,

I have simple measure for Cost per unit = DIVIDE(SUM([EXT_LINE_COST]),SUM([RECEIVED_QTY])), I want to fill the blanks in it with available value from right coloumn. For example in attached snip, the first row should have \$1.86 from column 202008 to 202108. I have Date table connected. Can someone please help me write the measure?

1 ACCEPTED SOLUTION
Super User

@Anonymous ,  Try like

if(isblank([Cost per unit]) , calculate(lastnonblankvalue(Date[Year Month], [Cost per unit]) , filter(all('Date'), Date[Month Year] <= Max(Date[Year Month]) ) ) , [Cost per unit])

2 REPLIES 2
Anonymous
Not applicable

Hi Amit,

Thank you for the soloution. I used the measure you provided (I named it Cost) and it almost worked. the total for Cost measure is summing the values from Cost. Is it possibel to SUM the values of Cost Measure?

Super User

@Anonymous ,  Try like

if(isblank([Cost per unit]) , calculate(lastnonblankvalue(Date[Year Month], [Cost per unit]) , filter(all('Date'), Date[Month Year] <= Max(Date[Year Month]) ) ) , [Cost per unit])