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.
Hey Everyone,
I am new here and i am wondering whether i can use a date as a variable in a messure.
I tried using below but i am getting an error saying "A function 'CALCULATE' has been used in a True/False expression that is used as a table filter expression. This is not allowed."
Solved! Go to Solution.
try this
24Months =
VAR EndDate = DATE(2023, 1, 31)
VAR StartDate = DATE(YEAR(EndDate) - 2, MONTH(EndDate), DAY(EndDate))
RETURN
CALCULATE([Total_FG], Date_Table[Date] >= StartDate, Date_Table[Date] <= EndDate, DATEADD(Date_Table[Date], 1, MONTH))
Thanks,
Arul
try this
24Months =
VAR EndDate = DATE(2023, 1, 31)
VAR StartDate = DATE(YEAR(EndDate) - 2, MONTH(EndDate), DAY(EndDate))
RETURN
CALCULATE([Total_FG], Date_Table[Date] >= StartDate, Date_Table[Date] <= EndDate, DATEADD(Date_Table[Date], 1, MONTH))
Thanks,
Arul
Thank you so much Arul! This works!!!
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 |
---|---|
113 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |