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 requirement to show the PYTD in data which i need to achieve by adding into M query.
I tried the below approach and its giving the previous year but only for two months:
#"FILTER"=Table.SelectRows(#"Changed Type",each ([Transaction Detail.Production Period] >=#date(Date.Year(DateTime.LocalNow()) -1 , Date.Month(DateTime.LocalNow())-1, 1))
and ([Transaction Detail.Production Period] <#date(Date.Year(DateTime.LocalNow()) -1 , Date.Month(DateTime.LocalNow())+1, 1)))
in
#"FILTER"
I need to show it for all months from Jan 2021 to Dec 2021.
Kindly help.
Thanks
Solved! Go to Solution.
@Anonymous , As you need full year, You can compare to year -1
#"FILTER"=Table.SelectRows(#"Changed Type",each (Date.Year([Transaction Detail.Production Period]) =Date.Year(DateTime.LocalNow()) -1 ))
in
#"FILTER"
Hi,
How can i get all three in one like :
MTD, YTD, PYMTD and PYYTD
You could hardcode the months. 1 and 12
Is it really previous year To date or is it subtract 1 year and return the calendar year's data?
@Anonymous , As you need full year, You can compare to year -1
#"FILTER"=Table.SelectRows(#"Changed Type",each (Date.Year([Transaction Detail.Production Period]) =Date.Year(DateTime.LocalNow()) -1 ))
in
#"FILTER"
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 |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |