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

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.

Reply
sajal161292
Helper V
Helper V

Need to extend the data across multiple dates

Hi,

 

 

I am working on a visual in Power BI in which I would like to copy the previous week's quantity to the next week if it does not exists and keep the same values if it exists.

 

short_xls4.png

As an example in the 1st row there is no quantity against the dates 2/26/2018 and 2/27/2018...so it should be previous week's value(0 0 11359)  i.e. it should retain the Total order type(which is a calculated field) 

Total = Demand + Supply

 

 short_xls7.png

Need to create a DAX measure for this functionality.

So could you please tell me a way of achieving it in Power BI?

 

 

Please find the link of my PBI file attached below:

https://drive.google.com/open?id=1cCnbdHqfSGa4q_ktrzcPiYv1dM8GrAZj

3 REPLIES 3
v-huizhn-msft
Employee
Employee

Hi @sajal161292,

After test, I can not find a way. While there is no quantity against the dates 2/26/2018 and 2/27/2018, it should display the previous week value(0 0 11359), the previous week of 2/26/2018 means from 2/19/2018 to 2/26/2018?

Best Regards,
Angelia

Hi,

 

My bad...It should be previous date's data (Total field at the bottom is the sum of Demand and Supply). 

It should be like:

Demand  0

Supply 0

Total 11359 (in this example).

 

In case of missing quantitites the Demand and Supply must be zero.

Total should remain same as that of previous date.

Hi,

 

I am trying to use this dax measure:

 

Condition Check =
VAR lastday =
CALCULATE (
MAX ( 'Shortages'[Due Date] ),
FILTER (
ALL ( 'calendar'[Date] ),
'calendar'[Date] < MAX ( 'calendar'[Date] )
))
var ordr = SELECTEDVALUE(Shortages[Order type])

return if(ISBLANK(min(Shortages[Due Date])),
SWITCH(ordr,"Total",CALCULATE(SUM(Shortages[quantity]),FILTER(all('calendar'),'calendar'[Date]=lastday)),
" "),SUM(Shortages[quantity]))

 

But it is not giving me the desired output.

Can someone please help?

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.