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,
To calculate my average YTD I need to have the days I produced on since the first of January this year. So I can divide my YTD to this number.
I tried this code:
Cumulative Quantity test =
CALCULATE (
distinctcount(EBAN[Requisition Date]);
FILTER (
ALLSELECTED( 'Date'[Date]);
DATE(YEAR('Date'[Date]);01;01) <= 'Date'[Date] <= MAX ( 'Date'[Date] )
))
but it doesn't seem to work.. Does anyone have an idea how i can make it work?
Solved! Go to Solution.
@Sofie try this
Cumulative Quantity test =
VAR MaxDate = CALCULATE(MAX('Date'[Date]))
Return CALCULATE (
distinctcount(EBAN[Requisition Date]);
FILTER (
ALLSELECTED(EBAN);
EBAN[Requisition Date] >= DATE(YEAR(MaxDate),'01','01') && EBAN[Requisition Date] < MaxDate
))
@Sofie try this
Cumulative Quantity test =
VAR MaxDate = CALCULATE(MAX('Date'[Date]))
Return CALCULATE (
distinctcount(EBAN[Requisition Date]);
FILTER (
ALLSELECTED(EBAN);
EBAN[Requisition Date] >= DATE(YEAR(MaxDate),'01','01') && EBAN[Requisition Date] < MaxDate
))
Thank you for the fast respond, it seems to work 🙂
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 |
---|---|
111 | |
94 | |
83 | |
67 | |
59 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |