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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.