The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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!!!
User | Count |
---|---|
79 | |
73 | |
39 | |
30 | |
28 |
User | Count |
---|---|
108 | |
99 | |
55 | |
49 | |
46 |