The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
I have the following scenario: a table of product data that has a "updated time" column. The most useful info for current status reports is obviously the latest, so I'm thinking of including the calculated column "is latest" as shown below
Product ID | Qty | Updated time | Is latest |
001 | 5 | 1/12/2023 10:00 AM | 1 |
002 | 4 | 1/12/2023 11:00 AM | 1 |
001 | 2 | 1/12/2023 9:00 AM | 0 |
The problem is, when I attempt to calculate the Is latest value with a simple IF(Updated time = MAX(Updated time),1,0) it will compare the Updated time from Product 001 with the Updated time from Product 002, so it will only mark with a "1" the most recently updated product.
Is there a way to include a filter by Product ID in the formula? I've tried a couple of things but I can't find a way to filter the calculation by the ID without specifying an ID in particular.
Any help would be appreciated!
Solved! Go to Solution.
Hi @Theresaz
Please try
Is Latest =
IF (
'Table'[Updated time]
= CALCULATE (
MAX ( 'Table'[Updated time] ),
ALLEXCEPT (
'Table',
'Table'[Product ID]
)
),
1
)
Hi @Theresaz
Please try
Is Latest =
IF (
'Table'[Updated time]
= CALCULATE (
MAX ( 'Table'[Updated time] ),
ALLEXCEPT (
'Table',
'Table'[Product ID]
)
),
1
)
To get the "Updated time maximum" by "Product", try this DAX formula:
IF([Updated time] = CALCULATE(MAX([Updated time]), ALLEXCEPT('Your table',[Product]),1,0)
User | Count |
---|---|
16 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
25 | |
13 | |
12 | |
8 | |
8 |