Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Administrator
3 years ago

Fill in data

Very good, I continue with my problems to fill in data.

If someone can tell me where to look to understand how Power BI deals with these problems, I would appreciate it.

In the meantime I pose the problem, I have simplified it to the maximum. Obviously there are many articles

I have three a table with three columns

Article Price Date

122 6,3797 23/10/2022

122 6,4459 25/10/2022

122 5,0000 01/12/2022

What I want is to generate a table like the following:

Month October November December

Article 6.4128 6.4128 5

That is to say for November that has no movements, I take the average of the last month with data, which can be the previous or more behind.

If I use

Media = AVERAGE(fLineasPedidos[Price]) I have the average for the months with values, but November leaves it blank
If I use
Last Measure =
CALCULATE (
LASTNONBLANKVALUE ( dFechas[Date], [Media] ),
dFechas[Date] <= .MAX ( dFechas[Date] )
)
I am not dragged by the average of the previous month, but by the average of the last day of the month.
That is to say for October and November it puts me 6.4459 if I had several values for that day if I calculate its average.
The truth is that I am a little lost and a little desperate since I have already made several consultations of the same style (with different criteria) that very kindly aveis answered, but I would like to be able to understand what escapes me and be able to understand the codes that you raise, that work correctly, everything is said in passing.
Thank you very much in advance

2 Replies

  • v-xiaotang's avatar
    v-xiaotang
    Community Support

    Hi Syndicate_Admin 

    Thanks for reaching out to us.

    the sample data is not enough to move on, could you share more data or a sample .pbix file ?

     

     

    Best Regards,

    Community Support Team _Tang

    If this post helps, please consider Accept it as the solution to help the other members find it more quickly.