March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi All,
I am building a model that compares data year-over-year against an event date that changes each year. I pulled a solution off a forum, and created a calculated column in my date table that compares each row to the Event Date:
I added a 'DateFilter' to constrain the data in visuals, simplify YoY comparative metrics, etc. Initially, I tried to do this with a Measure based on Max purchase date and the event date:
The solution I came up with was to recreate the measure as a variable in the calculated column:
My question is: why doesn't using the Measure in the calculated column expression work? As written above, the measure is calculated as a date. I was able to convert it to a whole number by putting it inside Value() and DateValue() functions, or rewriting it as a DATEDIFF function; this generated a different, but still incorrect, results. The only thing that worked was hardcoding the Measure's value e.g.: CURRENTDAYSOUT= -32. So in theory there must be a way to get the Measure to work in this context. The variable in the calculated column is basically a copy of the measure, and it works. I am still pretty green with Dax, so any perspective would be appreciated.
Solved! Go to Solution.
@KBrez Columns are not dynamic. They are calculated at the time of data load/refresh.
@KBrez Columns are not dynamic. They are calculated at the time of data load/refresh.
Thanks @Greg_Deckler . So as a general rule should I avoid referencing Measures in Calculated Columns?
@KBrez Correct. 99 times out of a 100 it isn't going to work like you want.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
115 | |
76 | |
57 | |
52 | |
44 |
User | Count |
---|---|
164 | |
116 | |
63 | |
57 | |
50 |