Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!
So my Data is in the following format.
| ReportDate | UpdateDate | Column A | Column B |
| 31st December 2020 | 20/12/2020 8:00:00 | 10 | 80 |
| 31st December 2020 | 15/12/2020 10:30:00 | 88 | 00 |
| 31st December 2020 | 01/12/2020 8:00:00 | 44 | 32 |
| 30th November 2020 | 29/11/2020 10:30:00 | 90 | 99 |
| 30th November 2020 | 26/11/2020 14:00:33 | 44 | 67 |
| 30th November 2020 | 15/11/2020 15:00:44 | 50 | 20 |
I need to add one CALCULATED COLUMN, say FLAG, which becomes 1 when it encounters latest update date at that reporting period
| ReportDate | UpdateDate | Column A | Column B | Flag |
| 31st December 2020 | 20/12/2020 8:00:00 | 10 | 80 | 1 |
| 31st December 2020 | 15/12/2020 10:30:00 | 88 | 00 | 0 |
| 31st December 2020 | 01/12/2020 8:00:00 | 44 | 32 | 0 |
| 30th November 2020 | 29/11/2020 10:30:00 | 90 | 99 | 1 |
| 30th November 2020 | 26/11/2020 14:00:33 | 44 | 67 | 0 |
| 30th November 2020 | 15/11/2020 15:00:44 | 50 | 20 | 0 |
Solved! Go to Solution.
You can convert that expression to a measure and use it in a visual with the UpdateDate and ReportDate columns as follows
NewFlagColumn =
VAR vMaxThisPeriod =
CALCULATE (
MAX ( Report[UpdateDate] ),
ALLEXCEPT (
Report,
Report[ReportDate]
)
)
RETURN
IF (
MIN(Report[UpdateDate]) = vMaxThisPeriod,
1,
0
)
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
You can convert that expression to a measure and use it in a visual with the UpdateDate and ReportDate columns as follows
NewFlagColumn =
VAR vMaxThisPeriod =
CALCULATE (
MAX ( Report[UpdateDate] ),
ALLEXCEPT (
Report,
Report[ReportDate]
)
)
RETURN
IF (
MIN(Report[UpdateDate]) = vMaxThisPeriod,
1,
0
)
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Here is a column expression that should work. Replace Report with your actual table name. Note that I had to convert your first two columns to Date and Date/Time.
NewFlagColumn =
VAR vMaxThisPeriod =
CALCULATE (
MAX ( Report[UpdateDate] ),
ALLEXCEPT (
Report,
Report[ReportDate]
)
)
RETURN
IF (
Report[UpdateDate] = vMaxThisPeriod,
1,
0
)
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
strangely, it gives me a red line under the Calculate function and the tool tip is "CALCULATE is not a function"
BTW, the table is a result of DIRECT QUERY
The Power BI Data Visualization World Championships is back! It's time to submit your entry.
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 70 | |
| 44 | |
| 34 | |
| 28 | |
| 23 |
| User | Count |
|---|---|
| 143 | |
| 124 | |
| 59 | |
| 40 | |
| 32 |