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
daninemeth
Frequent Visitor

Get the price from a period and recalculate the sales within a range

Hi Guys,

 

I'm having troubles to make a measure for the following problem:

 

I have 2 tables,

the first is the sales table (containing billed amount of a product on a date)

sales tablesales table

The second is my price table, containing the period prices of the produkt.

price tableprice table

 

The main task, how can I retrieve the Price from the Pricing table(I only have periods here), based on the Sales Table - Billing Date (these are exact dates)? And I'm only interested in the last 1 year, based on the latest Price Start Date.

 

I.e. : Produkt A - has a latest Price Start Date from 01/11/2021, so I only want to see the results from 01/10/2020 on the Billing Side.

 

Thanks for your help in advance!

 

Dani

6 REPLIES 6
mangaus1111
Solution Sage
Solution Sage

Hi @daninemeth ,

see my pbi file

https://1drv.ms/u/s!Aj45jbu0mDVJizHMCAOklnQ074Xt?e=fhY9CK

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

Hi @mangaus1111 ,

 

this is great! Amazing. Do you know the solution for the other direction? So, I'd like to see the price what was one year ago compared to that produkt latest price date, for every period.

 

Thanks for your help!

 

Dani

sorry I don´t understand this second question

Hi @mangaus1111 ,

 

sorry. I try with results:

 

so lets check what was the latest price start date for Product A and take the price what was 1 year ago based on latest price date and insert the price in to the sales table up to the the billing date is less or equal the latest price date.

results.png

mangaus1111
Solution Sage
Solution Sage

Hi @daninemeth , can you please show your exprected result in the Sales Table?

Hi @mangaus1111 ,

 

sure!

Basicaly, get the sales price from the correct period based on billing date and if the the billing date is a year older based on the latest start price return zero/ empty.

 

 

daninemeth_1-1667058454221.png

 

 Thanks!

 

Dani

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.