Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi,
I have three columns. I would like to keep only duplicate value and replace the others with zero. Is there a way to accomplish that?
*Note: Count is calculated column.
| Author | Count | % | Final outcome |
| Apple | 8 | 30% | 30% |
| Apple | 8 | 30% | 0% |
| Apple | 37 | 40% | 40% |
| Apple | 37 | 40% | 0% |
| Apple | 37 | 40% | 0% |
| Boy | 2 | 10% | 10% |
| Boy | 2 | 10% | 0% |
| Boy | 2 | 10% | 0% |
| Boy | 2 | 10% | 0% |
Solved! Go to Solution.
1.Add the index column to the powerquery:
2.Create calculated column references:
Column =
VAR FIRST=CALCULATE(MIN('Table'[Index]),ALLEXCEPT('Table','Table'[Author],'Table'[Count]))
RETURN IF('Table'[Index]=FIRST,'Table'[%],BLANK())Column 2 =
VAR CI='Table'[Author]
VAR ci2='Table'[Count]
VAR RANKC=RANKX(FILTER('Table','Table'[Author]=CI&&'Table'[Count]=ci2),'Table'[Index],,ASC,Dense)
RETURN IF(RANKC=1,'Table'[%],BLANK())
I've given you two options that you can choose according to your needs.
3.Here's my final result, which I hope meets your requirements.
4.Here are some posts that are similar to your problem:
Solved: Group by ID Skip Aggregation - Microsoft Fabric Community
Please find the attached pbix relevant to the case.
If you have any other questions, please contact us.
Best Regards,
Leroy Lu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
1.Add the index column to the powerquery:
2.Create calculated column references:
Column =
VAR FIRST=CALCULATE(MIN('Table'[Index]),ALLEXCEPT('Table','Table'[Author],'Table'[Count]))
RETURN IF('Table'[Index]=FIRST,'Table'[%],BLANK())Column 2 =
VAR CI='Table'[Author]
VAR ci2='Table'[Count]
VAR RANKC=RANKX(FILTER('Table','Table'[Author]=CI&&'Table'[Count]=ci2),'Table'[Index],,ASC,Dense)
RETURN IF(RANKC=1,'Table'[%],BLANK())
I've given you two options that you can choose according to your needs.
3.Here's my final result, which I hope meets your requirements.
4.Here are some posts that are similar to your problem:
Solved: Group by ID Skip Aggregation - Microsoft Fabric Community
Please find the attached pbix relevant to the case.
If you have any other questions, please contact us.
Best Regards,
Leroy Lu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
I am trying to use these formulas for power query, however, it keeps returning syntax errors. I think the issue I have is settign up the calculated column reference. I cannot use these formulas within a custom column field.
Can you please explain how you are building this column?
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 20 | |
| 11 | |
| 10 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 32 | |
| 28 | |
| 19 | |
| 11 | |
| 10 |