Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi all,
Want to ask how can I remove duplicate with if else condition? Do it have some formula for that?
Current data
Data that I want it to be view in powerbi
I try to remove duplicate the usage (unit) but there will be a possibility that the usage (unit) have same value on different day. (in this case 9 & 10).
So my idea is = if production order have duplicate value then remove duplicate usage (unit)
Any help?
Regards,
Nuha
Can you explain more which rows you expect to drop or keep and why?
Hi @stenford23 ,
I want to drop the yellow highlighted row and remain the not highlighted row.
Because as you can see in the red highlighted data is different.
Regards,
Nuha
Table.Distinct(
Table.Buffer(
Table.Sort(
original_table,
{"End Time", Order.Ascending}
)
), {"Usage (Unit)}"
)
Sort by End date (add start date also if you need it), Buffer it (otherwise it won't work) and get distinct.
Yes @Anonymous insert this code in advanced editor
replace original_table with previous step name
Hi @stenford23 ,
Sorry I dont quite understand. Please refer as below for my advanced editor
Regards,
Nuha
Replace the code i give to you with
drop_duplicates = Table.Distinct(
Table.Buffer(
Table.Sort(
#"Expanded SAP__PPT_EV_ProductionOrderConfirmationAdd (3)",
{"End Time", Order.Ascending}
)
), {"Usage (Unit)}"
)
in
drop_duplicates
Change also what comes after "in" by replacing it with drop_duplicates (as in the code above)
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.