Forum Discussion
Creating unique table without duplicate values
- 1 year ago
Hi Molin ,
Thanks for reaching out to Microsoft Fabric Community.
I reviewed your scenario and tried to reproduce it using a small sample dataset with similar structure.
With the below sample data:Calculated Table:
PU_Times = ADDCOLUMNS ( SUMMARIZE ( FILTER ( 'TransactionDetails', 'TransactionDetails'[ObjectNumber] = 999000009 ), 'TransactionDetails'[GuestCheckId] ), "Latest_Reference", VAR curCheckId = 'TransactionDetails'[GuestCheckId] RETURN CALCULATE ( MAX ( 'TransactionDetails'[Reference] ), FILTER ( 'TransactionDetails', 'TransactionDetails'[GuestCheckId] = curCheckId && 'TransactionDetails'[ObjectNumber] = 999000009 ), TOPN ( 1, FILTER ( 'TransactionDetails', 'TransactionDetails'[GuestCheckId] = curCheckId && 'TransactionDetails'[ObjectNumber] = 999000009 ), 'TransactionDetails'[PostingTime], DESC ) ) )The output was:
Let me know if this meets your requirement. If not, feel free to share a small sample of your dataset or a PBIX file (with any sensitive data removed), and I’ll be glad to take a closer look.
Please consider marking this as the accepted solution if it helps, to assist others facing a similar issue.
Thnak you.
Please find the attached .pbix for reference.
Hi Molin ,
Thanks for reaching out to Microsoft Fabric Community.
I reviewed your scenario and tried to reproduce it using a small sample dataset with similar structure.
With the below sample data:
Calculated Table:
PU_Times =
ADDCOLUMNS (
SUMMARIZE (
FILTER (
'TransactionDetails',
'TransactionDetails'[ObjectNumber] = 999000009
),
'TransactionDetails'[GuestCheckId]
),
"Latest_Reference",
VAR curCheckId = 'TransactionDetails'[GuestCheckId]
RETURN
CALCULATE (
MAX ( 'TransactionDetails'[Reference] ),
FILTER (
'TransactionDetails',
'TransactionDetails'[GuestCheckId] = curCheckId &&
'TransactionDetails'[ObjectNumber] = 999000009
),
TOPN (
1,
FILTER (
'TransactionDetails',
'TransactionDetails'[GuestCheckId] = curCheckId &&
'TransactionDetails'[ObjectNumber] = 999000009
),
'TransactionDetails'[PostingTime],
DESC
)
)
)
The output was:
Let me know if this meets your requirement. If not, feel free to share a small sample of your dataset or a PBIX file (with any sensitive data removed), and I’ll be glad to take a closer look.
Please consider marking this as the accepted solution if it helps, to assist others facing a similar issue.
Thnak you.
Please find the attached .pbix for reference.
Dear v-veshwara-msft ,
Thank you so much! It works perfectly and solves the issue with a one-to-one solution.
Your time and generosity is much appreciated.
Kind regards.