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.
Hi all, I am new to Power BI and I need some help with DAX here. I have an existing table like this:
I need to create a new table based on column [CreatedDate], extracting the latest records for each Site. From the example above, the latest record for Site A is from 1/1/2024 and Site B from 11/1/2023, giving us the new table as follows:
In Kusto, we can achieve this easily with arg_max() operator. I wonder anyone can help me compose the DAX query here. It would be much appreciated.
Solved! Go to Solution.
Hi,
Please check the below picture and the attached pbix file.
expected result table =
CALCULATETABLE (
Data,
TREATAS (
GROUPBY (
Data,
Data[Site],
"@maxdate", MAXX ( CURRENTGROUP (), Data[CreatedDate] )
),
Data[Site],
Data[CreatedDate]
)
)
Hi,
Please check the below picture and the attached pbix file.
expected result table =
CALCULATETABLE (
Data,
TREATAS (
GROUPBY (
Data,
Data[Site],
"@maxdate", MAXX ( CURRENTGROUP (), Data[CreatedDate] )
),
Data[Site],
Data[CreatedDate]
)
)
User | Count |
---|---|
26 | |
10 | |
8 | |
6 | |
6 |
User | Count |
---|---|
31 | |
11 | |
10 | |
10 | |
9 |