Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Example data below:
| ID | Fty | Status | Date | ||||
| 1 | Facility A | Active | 1/1/2020 | ||||
| 2 | Facility B | Active | 1/1/2021 | ||||
| 3 | Facility A | Active | 1/1/2021 | ||||
| 4 | Facility C | Active | 1/1/2022 | ||||
| 5 | Facility A | Inactive | 1/1/2022 | ||||
| 6 | Facility B | Active | 1/1/2023 |
I'm trying to get the Status of the Facility based on the Date column. I am able to do this as a measure below however I would like to get it as a calculated column?
Expected output:
| Fty | Status | ||
| Facility A | Inactive | ||
| Facility B | Active | ||
| Facility C | Active |
~Current Status =
VAR _val = MAX('Data'[Date])
RETURN
MAXX(
FILTER(
'Data',
'Data'[Date] = _val && 'Data'[Fty] = MAX('Data'[Fty])
),
'Data'[Status]
)
Hi @olimilo ,
@talespin nice method!And you can also consider using the following code to meet your needs.
Based on your description, please try code as below to create a Calcualted table.
New Table =
VAR MaxDate =
MAXX ( ALLEXCEPT ( 'Table', 'Table'[Fty] ), 'Table'[Date] )
VAR TempTable =
ADDCOLUMNS (
VALUES ( 'Table'[Fty] ),
"Status",
MAXX (
FILTER (
'Table',
'Table'[Fty] = EARLIER ( 'Table'[Fty] )
&& 'Table'[Date] = [MaxDate]
),
'Table'[Status]
)
)
RETURN
TempTable
Result is as below.
Best Regards,
Yulia Yan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
hi @olimilo ,
Please test this.
First calculating max date for each facility by removing all filters on table except facility.
Then using this date to find the status for each facility.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 5 | |
| 5 | |
| 4 |
| User | Count |
|---|---|
| 25 | |
| 16 | |
| 8 | |
| 7 | |
| 7 |