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.
Hi,
I have tried to calculate YTD till previous month using following formula,
YTD sales = Calculate(TOTALYTD('TABLE'[SALES],'CALENDAR'[DATE'), FILTER('CALENDAR','CALENDAR'[YEAR] = YEAR(TODAY()) && 'CALENDAR'[MONTH_NO] = MONTH(TODAY())-1))))
But I'm not getting correct results.
Please help me to do it.
Thanks,
AshDil.
Solved! Go to Solution.
@AshDil , Try a measure like
YTD Today till last month =
var _min = Date(year(Today()),1,1)
var _day = eomonth(today(),-1)
return
CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Date] >=_min && 'Date'[Date] <= _day) )
Remove all date date it date is not selected
YTD Today till last month =
var _min = Date(year(Today()),1,1)
var _day = eomonth(today(),-1)
return
CALCULATE(sum('Table'[Qty]), FILTER(('Date'),'Date'[Date] >=_min && 'Date'[Date] <= _day) )
Hi,
Please check the below picture and the attached pbix file.
All measures are in the attached pbix file.
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Hi,
Please check the below picture and the attached pbix file.
All measures are in the attached pbix file.
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
@AshDil , Try a measure like
YTD Today till last month =
var _min = Date(year(Today()),1,1)
var _day = eomonth(today(),-1)
return
CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Date] >=_min && 'Date'[Date] <= _day) )
Remove all date date it date is not selected
YTD Today till last month =
var _min = Date(year(Today()),1,1)
var _day = eomonth(today(),-1)
return
CALCULATE(sum('Table'[Qty]), FILTER(('Date'),'Date'[Date] >=_min && 'Date'[Date] <= _day) )
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 |
---|---|
110 | |
94 | |
80 | |
67 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |