Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I'm currently calculating the materials average unit price in the last 30 days.
In some cases, formula return blank, because there weren't any purchases for particular items.
For those cases, I want to return the last available value - I mean the last available purchase.
Any idea how to do this?
Thanks in advance 😉
Solved! Go to Solution.
@amitchandak
I did some adjustments and now it looks like this.
It seems to be working, but maybe there is something that I've missed.
Please verify, thanks
@pawelj795 , seem fine. you could have created a couple of measures and just handled then here.
Hi @pawelj795 ,
You can refer to the formula.
Measure =
VAR x =
CALCULATE(
AVERAGEX(
'Table',
DIVIDE( 'Table'[c1], 'Table'[c2] * 'Table'[c3], BLANK() )
),
DATESINPERIOD( 'Table'[Date], MAX('Table'[Date]), -30, DAY ),
USERELATIONSHIP( )
)
RETURN
IF(
x = BLANK(),
CALCULATE(),
x
)
Best regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@pawelj795 , This can you data of last available date with help from a date table. so when 30-day value is null you can use this
Last Day Non Continous = CALCULATE(sum('order'[Qty]),filter(all('Date'),'Date'[Date] =MAXX(FILTER(all('Date'),'Date'[Date]<max('Date'[Date])),Table['Date'])))
Hi @amitchandak
Thanks for your reply, but could you help me with the implementation of your adjustment?
I tried by myself, but it returns only blanks.
@amitchandak
I did some adjustments and now it looks like this.
It seems to be working, but maybe there is something that I've missed.
Please verify, thanks
@pawelj795 , seem fine. you could have created a couple of measures and just handled then here.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
88 | |
63 |