Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hello,
I have a sales table that shows sales by month, but also populates expected sales in the same column for previous months. To filter out previous months I have used the following expressions:
Solved! Go to Solution.
if it's always full month until new data is released then you could use EOMONTH, like that:
DateswithSales = IF('Date'[Date] <= EOMONTH(TODAY(), -1), TRUE , FALSE)
it will return 31st July during all days of August, and start returning 31st August as of 1st September
First of all, please stop writing things like
DateswithSales = IF('Date'[Date]<=TODAY(),true,false)
when this will do
DateswithSales = 'Date'[Date] <= TODAY()
The expression returns a logical value you're after so what's the use of IF?
Secondly, in the same vein, not
CurrentSales= CALCULATE(sum(data_volume[SALES_BBLS]),FILTER('Date','Date'[DateswithSales]=true))
but
CurrentSales = CALCULATE( SUM( data_volume[SALES_BBLS]), 'Date'[DateswithSales] -- this is already a logical expression )
And thirdly, @Stachu has probably given you the correct measure but please remove the unnecessary clutter from it as shown above.
Best
Darek
Thank you for the great advice!
if it's always full month until new data is released then you could use EOMONTH, like that:
DateswithSales = IF('Date'[Date] <= EOMONTH(TODAY(), -1), TRUE , FALSE)
it will return 31st July during all days of August, and start returning 31st August as of 1st September
this worked, thanks!!
User | Count |
---|---|
41 | |
27 | |
23 | |
19 | |
16 |
User | Count |
---|---|
55 | |
35 | |
21 | |
18 | |
15 |