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.
My requirement is that I have a table where I need to check whether the column values are duplicated or distinct based on another column selection with more than 1 value selected.
Steps:
1. From below table First Concatenate HPPN & MPN columns .
2. Now Countrows based on HPPN_MPN concatenated column
ex: check HPPN1_MPN1 is reflecting in any other SKU from SKU1.
In SKU2 also HPPN1_MPN1 is available so this is common in both SKU1 and SKU2.
3. Till here i was able to do by using countrows.
SKU | HPPN | MPN | Product selected | Common/Distinct |
SKU1 | HPPN1 | MPN1 | TRUE | Common |
SKU1 | HPPN1 | MPN2 | TRUE | Common |
SKU1 | HPPN1 | MPN3 | TRUE | Common |
SKU1 | HPPN2 | MPN4 | TRUE | Common |
SKU1 | HPPN2 | MPN5 | TRUE | Common |
SKU1 | HPPN3 | MPN6 | TRUE | Distinct |
SKU1 | HPPN3 | MPN7 | TRUE | Distinct |
SKU1 | HPPN4 | MPN8 | TRUE | Distinct |
SKU1 | HPPN5 | MPN9 | TRUE | Distinct |
SKU1 | HPPN6 | MPN10 | TRUE | Distinct |
SKU2 | HPPN7 | MPN11 | TRUE | Distinct |
SKU2 | HPPN8 | MPN12 | TRUE | Distinct |
SKU2 | HPPN2 | MPN4 | TRUE | Common |
SKU2 | HPPN2 | MPN5 | TRUE | Common |
SKU2 | HPPN1 | MPN1 | TRUE | Common |
Solved! Go to Solution.
Hi @Bhaskar_K1986 ,
Since the calculated column is recomputed when the memory is refreshed, it will not be interacting with the slicer when it finishes its calculation. So if you want to get dynamic results, you may consider using a measure to handle this question.
Please new a measure:
Common/Distinct =
VAR _HPPN =
MAX ( 'Table'[HPPN] )
VAR _MPN =
MAX ( 'Table'[MPN] )
VAR _count =
CALCULATE (
COUNTROWS ( 'Table' ),
FILTER ( ALLSELECTED ( 'Table' ), 'Table'[HPPN] = _HPPN && 'Table'[MPN] = _MPN )
)
VAR _result =
IF ( _count > 1, "Common", "Distinct" )
RETURN
_result
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data
Hi @Bhaskar_K1986 ,
Since the calculated column is recomputed when the memory is refreshed, it will not be interacting with the slicer when it finishes its calculation. So if you want to get dynamic results, you may consider using a measure to handle this question.
Please new a measure:
Common/Distinct =
VAR _HPPN =
MAX ( 'Table'[HPPN] )
VAR _MPN =
MAX ( 'Table'[MPN] )
VAR _count =
CALCULATE (
COUNTROWS ( 'Table' ),
FILTER ( ALLSELECTED ( 'Table' ), 'Table'[HPPN] = _HPPN && 'Table'[MPN] = _MPN )
)
VAR _result =
IF ( _count > 1, "Common", "Distinct" )
RETURN
_result
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data
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.
User | Count |
---|---|
18 | |
7 | |
6 | |
5 | |
5 |
User | Count |
---|---|
25 | |
10 | |
10 | |
9 | |
7 |