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
Broeselchen
Helper III
Helper III

Revenue with two dates

I have a table with some customerIDs and e few orders per customer. Then I have an other table with some customerIDs (also not unique) and dates they received a mailing. Now I want to see the revenue the customer made in the 5 days after receiving the mailing. Maybe, I can do it in power query, in a calcualte column or in a measure. I'm not sure, what is the best. Here an example:

Broeselchen_0-1677089277850.png

Any ideas?

2 REPLIES 2
Broeselchen
Helper III
Helper III

Thanks, but it does not work, the results are empty. But I found an other solution.

v-yueyunzh-msft
Community Support
Community Support

Hi, @Broeselchen 

According to your dexcription, you want to get the " the revenue the customer made in the 5 days after receiving the mailing".

I think you can create a calculated column in Power BI Desktop.

You can try to use this dax code:

Column = var cur_order_date = [order date] 
var _t = FILTER('Table2' , 'Table2'[mailing date]<=cur_order_date &&  'Table2'[mailing date] >=cur_order_date-5)
return
IF(COUNTROWS(_t)>0 , [revenue] ,BLANK())

Then we can meet your need , the result is as follows:

vyueyunzhmsft_0-1677203233549.png

 

 

If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem. (You can also upload you sample .pbix [without sensitive data] to the OneDrive and share with the OneDrive link to me ! )

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

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

 

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.