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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
shamnadkalathil
Frequent Visitor

Show values between dates selection

Hi all,

 

I have a report page which shows Item sales details. Now I want to map cost of the item on each line.

 

The Cost table is like as follows:

ItemNumberPostingDateUoMCost
300238302/01/2022PC0.090
300238305/01/2022PC0.095
300238312/01/2022PC0.100
300238313/01/2022PC0.960

 

If I run the Sales report from 02/01/2022 to 12/01/2022, the cost for the aboive item should show as

from 02/01/2022 to 04/01/2022:  Cost: 0.090

from 05/01/2022 to 11/01/2022: Cost: 0.095

on 12/01/2022: the cost is 0.100

1 ACCEPTED SOLUTION

i did the data transform in PQ, pls see if this is what you want

11.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

6 REPLIES 6
shamnadkalathil
Frequent Visitor

@ryan_mayu Thank you

shamnadkalathil
Frequent Visitor

Hi @ryan_mayu Thank you, can u please share the .pbix file once again as I am getting error while opening it.

 

shamnadkalathil_0-1716971175654.png

 

i forgot to delete the visual. The output is the 'Merge' table.

 

11.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




shamnadkalathil
Frequent Visitor

@ryan_mayu  thank you for the quick response. my requirement is to show the cost price on respective sales line.

 

DateItemQuantityCostTotal CostSelling PriceTotalMargin
02/01/2024300238320.090.180.1150.230.05
03/01/2024300238310.090.090.1150.1150.025
05/01/20243002383100.0950.950.1151.150.2
10/01/2024300238350.0950.4750.1150.5750.1
12/01/2024300238320.10.20.1150.230.03

i did the data transform in PQ, pls see if this is what you want

11.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




ryan_mayu
Super User
Super User

you can create a measure

 

Measure =
VAR _date=max('date'[Date])
VAR _date2=maxx(FILTER('Table','Table'[PostingDate]<=_date),'Table'[PostingDate])
return maxx(FILTER('Table','Table'[PostingDate]=_date2),'Table'[Cost])
 
11.PNG
 
pls see the attachment below




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.