- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Calculate age based on a selected date
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

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! | |
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

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! | |

Helpful resources
Subject | Author | Posted | |
---|---|---|---|
02-16-2023 09:08 AM | |||
12-02-2022 05:06 AM | |||
02-08-2024 03:09 PM | |||
02-23-2024 07:05 AM | |||
12-20-2023 08:16 AM |
User | Count |
---|---|
113 | |
89 | |
84 | |
54 | |
46 |