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 All
@Vera_33 share with me below expression working fine , in order to return Qty for Jan - Mar 2021 , user need to manually tick on year=2021 , month =3 :-
Solved! Go to Solution.
@admin11 ,
Try like (small change in YTD and LYTD)
YTD=
var _min = date(year(today()),1,1)
var _day = today()
return
CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Year] =year(Today()) && 'Date'[Day of Year] <= _day) )
LYTD =
var _min = date(year(today())-1,1,1)
var _max = date(year(today())-1,month(today()),day(today()))
var _day = datediff(_min, _max,day)+1
return
CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Year] = year(Today())-1 && 'Date'[Day of Year] <= _max))
Below is the 2 expression work fine , user don't need to filter year & month :-
Hi Paul,
I actually don't quite understand your question, why you filter the date and the user needs to filter again? Did @amitchandak answer your question?
Below is the 2 expression work fine , user don't need to filter year & month :-
your exxpression below is working fine :-
@admin11 , YTD and LYTD , without use selecting a date
YTD=
var _min = date(year(today()),1,1)
var _day = datediff(_min, today(),day)+1
return
CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Year] =year(Today()) && 'Date'[Day of Year] <= _day) )
LYTD =
var _min = date(year(today())-1,1,1)
var _max = date(year(today())-1,month(today()),day(today()))
var _day = datediff(_min, _max,day)+1
return
CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Year] = year(Today())-1 && 'Date'[Day of Year] <= _day))
Thank you so much for your sharing. i try to use your expression i get null display.
My PBI file :-
https://www.dropbox.com/s/hh9isfpxb99m5t9/PBT_V2021_353%20LYTD%20COUNT.pbix?dl=0
Paul
@admin11 ,
Try like (small change in YTD and LYTD)
YTD=
var _min = date(year(today()),1,1)
var _day = today()
return
CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Year] =year(Today()) && 'Date'[Day of Year] <= _day) )
LYTD =
var _min = date(year(today())-1,1,1)
var _max = date(year(today())-1,month(today()),day(today()))
var _day = datediff(_min, _max,day)+1
return
CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Year] = year(Today())-1 && 'Date'[Day of Year] <= _max))
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 |
---|---|
114 | |
100 | |
75 | |
73 | |
49 |
User | Count |
---|---|
145 | |
109 | |
109 | |
90 | |
64 |