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

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

Reply
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?

 

 

Capture.PNG

 

1 ACCEPTED SOLUTION
amitchandak
Super User
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])

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

@amitchandak 

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?

 

Cost.PNG

amitchandak
Super User
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])

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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