Active Member
May 9, 2020
I have a power pivot to with daily sales tables and date reference table. The user inputs the date and I need to add a column that calculate the sales to that date. The date is refreshing to the date reference table and my formula is:
=if(Sales_report_[Doc_Date]<=RELATED('Date Reference'[Date]),Sales_report_[Gross Sales],0)
So in the above I need gross sales amount to show if the date of the sales (Doc_Date) is less or equal to the date on the reference table (Date Reference'[Date]); otherwise, show 0.
It is working but only shows gross sales for the dates within the same month. In other words, if the date reference is 02/28/2019 then it shows gross sales only for the rows within February 2019 but not January 2019. It is like not including the entire month in the if formula.
Active Member
May 9, 2020
Yes, I'm comparing to a date. The data model has a date reference table that populates from the user input on the spreadsheet.
=if(Sales_report_[Doc_Date]<=RELATED('Date Reference'[Date]),Sales_report_[Gross Sales],0)
The formula is looking to the 'Date Reference'[Date] table.
Active Member
May 9, 2020
The formula is working. However, it will only give me the rows for the same month. In other words, it will show only April for example if the date reference= 04/30/2020 but the formula is to show less or equal to April 30, 2020 so I'm expecting January 1 thru April 30th to show.
1 Guest(s)