Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
tyan
Helper II
Helper II

How to remove two duplicate columns and do filter

tyan_0-1640181513182.png

I would like to count unique value of  COLOR and MODEL (same color& same model happen muti time count once)

 

and filter only count the amount of color&model that is CANCEL ( those I highlight in yellow for example) 

 

Below table is the result I would like to see in powerbi matrix:

tyan_1-1640181777333.png

 

1 ACCEPTED SOLUTION
v-kkf-msft
Community Support
Community Support

Hi @tyan ,

 

You can try the following two methods.
1. Remove duplicate rows in the Power Query Editor and create the following measure.

 

vkkfmsft_0-1640581287000.png        vkkfmsft_1-1640581311125.png

Count of Cancel = 
CALCULATE (
    DISTINCTCOUNT ( Table1[Model] ),
    Table1[Analysis] = "Cancel"
)

 

2. Use the following measure directly.

 

Measure = 
CALCULATE (
    DISTINCTCOUNT ( Table2[Model] ),
    FILTER (
        DISTINCT ( Table2 ), 
        Table2[Analysis] = "Cancel"
    )
)

 

 remove.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

Best Regards,
Winniz

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-kkf-msft
Community Support
Community Support

Hi @tyan ,

 

You can try the following two methods.
1. Remove duplicate rows in the Power Query Editor and create the following measure.

 

vkkfmsft_0-1640581287000.png        vkkfmsft_1-1640581311125.png

Count of Cancel = 
CALCULATE (
    DISTINCTCOUNT ( Table1[Model] ),
    Table1[Analysis] = "Cancel"
)

 

2. Use the following measure directly.

 

Measure = 
CALCULATE (
    DISTINCTCOUNT ( Table2[Model] ),
    FILTER (
        DISTINCT ( Table2 ), 
        Table2[Analysis] = "Cancel"
    )
)

 

 remove.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

Best Regards,
Winniz

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Calculate(DISTINCTCOUNT('TABLE',[Color]),
        Filter('TABLE', [Analysis] = 'Cancel'

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors