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,
Thanks in advance for any help.
I am working on a project where we are trying to calculate the age of a person (Calculated colum) based on a selected date. Inother words, how old is this person at the end of a selected QTR.
I can make all the measures display the correct date as I select a QTR, but the calculated colum in the Fact_Person table doesn't update. It stays on the "alternative date". My assumtion is the calculated column is NOT aware of the selection change.
Here is the measure (basically)
Solved! Go to Solution.
Hi @jim_hubbardUIHS
Calculated column never aware about the selected QTR in visual.
You should create a measure, then you can show the Patient wise aga in visual
Calculate Age =
VAR SelectedQuarterStartDate =
CALCULATE(
MIN('Calendar'[Date]),
FILTER(
'Calendar',
'Calendar'[Quarter] = SELECTEDVALUE('Calendar'[Quarter]) &&
'Calendar'[Year] = SELECTEDVALUE('Calendar'[Year])
)
)
VAR CurrentDate =
IF(ISBLANK(SelectedQuarterStartDate), TODAY(), SelectedQuarterStartDate)
RETURN
DATEDIFF(MIN('YourTable'[DateOfBirth]), CurrentDate, MONTH)
Sample Measure code below
Proud to be a Super User! | |
Hi @jim_hubbardUIHS
Calculated column never aware about the selected QTR in visual.
You should create a measure, then you can show the Patient wise aga in visual
Calculate Age =
VAR SelectedQuarterStartDate =
CALCULATE(
MIN('Calendar'[Date]),
FILTER(
'Calendar',
'Calendar'[Quarter] = SELECTEDVALUE('Calendar'[Quarter]) &&
'Calendar'[Year] = SELECTEDVALUE('Calendar'[Year])
)
)
VAR CurrentDate =
IF(ISBLANK(SelectedQuarterStartDate), TODAY(), SelectedQuarterStartDate)
RETURN
DATEDIFF(MIN('YourTable'[DateOfBirth]), CurrentDate, MONTH)
Sample Measure code below
Proud to be a Super User! | |
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
132 | |
90 | |
88 | |
64 | |
58 |
User | Count |
---|---|
203 | |
141 | |
107 | |
73 | |
70 |