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.
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!!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
47 | |
23 | |
20 | |
15 | |
13 |
User | Count |
---|---|
51 | |
42 | |
39 | |
19 | |
19 |