Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I had a table contained multiple customers order details with date and time. From that table I want to create a new table that contain last purchase/order of each customer with all the product details(remaining columns from source table
Thanks in Advance.
Solved! Go to Solution.
@ddpl this is an alternative solution:
New Calculated Table =
VAR _filter =
TREATAS(
ADDCOLUMNS(
VALUES('Table'[Customer ID]),
"@Last Date", CALCULATE(MAX('Table'[Date]))
),
'Table'[Customer ID], 'Table'[Date]
)
RETURN
CALCULATETABLE(
'Table',
_filter
)
@ddpl this is an alternative solution:
New Calculated Table =
VAR _filter =
TREATAS(
ADDCOLUMNS(
VALUES('Table'[Customer ID]),
"@Last Date", CALCULATE(MAX('Table'[Date]))
),
'Table'[Customer ID], 'Table'[Date]
)
RETURN
CALCULATETABLE(
'Table',
_filter
)
New Calculated Table =
SELECTCOLUMNS(
GENERATE(
SELECTCOLUMNS(
ADDCOLUMNS(
VALUES('Table'[Customer ID]),
"@Last Date", CALCULATE(MAX('Table'[Date]))
),
"@Customer ID", [Customer ID] & "",
"@Last Date", [@Last Date]
),
VAR _current_customer = [@Customer ID]
RETURN
FILTER(
'Table',
'Table'[Date] = [@Last Date]
&& 'Table'[Customer ID] = _current_customer
)
),
"Customer ID", [Customer ID],
"Date", [Date],
"Product ID", [Product ID],
"Product Color", [Product Color],
"Price", [Price]
)
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
99 | |
98 | |
79 | |
74 | |
66 |
User | Count |
---|---|
136 | |
109 | |
104 | |
82 | |
73 |