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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
ppgandhi11
Helper V
Helper V

How to get a smaller subset?

 

 

Capture.PNG

 

I am sure this is easily done in power bi, but I need help in this. I want the NPI counted only once. So, A should have count of only 9 and not (9+9+9+9). similarly, B should have count of only 5 and not (5+5). How to do this in power bi? Thanks.

3 ACCEPTED SOLUTIONS
Vvelarde
Community Champion
Community Champion

@ppgandhi11

 

Hi, try with this measure

 

Measure =
IF (
    HASONEVALUE ( 'NPI Table'[NPI] ),
    AVERAGE ( 'NPI Table'[Service] ),
    SUMX (
        SUMMARIZE (
            'NPI Table',
            'NPI Table'[NPI],
            "AVG", AVERAGE ( 'NPI Table'[Service] )
        ),
        [AVG]
    )
)

Regards

 

Victor




Lima - Peru

View solution in original post

@Anonymous

 

Hi Raj,

 

As I explained in the post, for the given dataset, the result of total should be: 9+5+3 = 17 (A should be counted once with value 9, B should be counted once with a value 5 and C should be counted once with a value 3) . The entire record set I gave was for a specific field: Service.

 

Please let me know if attached clarifies the doubt. Thanks.

 

Capture.PNG

View solution in original post

Anonymous
Not applicable

Measure = SUMX(SUMMARIZE(Duplicate_Removal,Duplicate_Removal[NPI],"UniqNPI",AVERAGE(Duplicate_Removal[#ofService])),[UniqNPI])

 

Uniq.PNG

View solution in original post

8 REPLIES 8
Vvelarde
Community Champion
Community Champion

@ppgandhi11

 

Hi, try with this measure

 

Measure =
IF (
    HASONEVALUE ( 'NPI Table'[NPI] ),
    AVERAGE ( 'NPI Table'[Service] ),
    SUMX (
        SUMMARIZE (
            'NPI Table',
            'NPI Table'[NPI],
            "AVG", AVERAGE ( 'NPI Table'[Service] )
        ),
        [AVG]
    )
)

Regards

 

Victor




Lima - Peru

Hi @Vvelarde

 

Your solution works! I just needed a minor tweak. I had a drill through from earlier page so had to adjust it to consider all NPIs using calculate funtion and all(prov). Thanks a lot!

ppgandhi11
Helper V
Helper V

Please note that there are other columns too in the dataset which are used for other purpose so "remove duplicates" will not work in advanced editor. Thanks.

Anonymous
Not applicable

If you just want to display NPI and Service then you can have both columns in the table visial and select 'don't summarize' ' for 'Service' column in the values section as shown below.

 

Duplicate.PNG

 

Is this what you are looking for?

 

Thanks
Raj

No. That is not what I am looking for. This is how my data looks like after few manipulations and in one of the visuals.  because the systemkey is present, the rows are repeated.  I cannot get rid of systemkey. I want to count each NPI only once. So for NPI A, instead of counting 4 times 9, I want to count it only 1 time. As a result in below, my total # of service should be: 9+5+3 = 17. How to get that? I think this should be doable using DAX formulas. Thanks. One thing is guarenteed in the data. If the the combination is A-9, it is always going to be A-9.  

 

Capture.PNG

Anonymous
Not applicable


@ppgandhi11 wrote:

No. That is not what I am looking for. This is how my data looks like after few manipulations and in one of the visuals.  because the systemkey is present, the rows are repeated.  I cannot get rid of systemkey. I want to count each NPI only once. So for NPI A, instead of counting 4 times 9, I want to count it only 1 time. As a result in below, my total # of service should be: 9+5+3 = 17. How to get that? I think this should be doable using DAX formulas. Thanks. One thing is guarenteed in the data. If the the combination is A-9, it is always going to be A-9.  

 

Capture.PNG


For this dataset, how do you want to display the output? Could you pls post that as well.

 

 

Thanks

Raj

@Anonymous

 

Hi Raj,

 

As I explained in the post, for the given dataset, the result of total should be: 9+5+3 = 17 (A should be counted once with value 9, B should be counted once with a value 5 and C should be counted once with a value 3) . The entire record set I gave was for a specific field: Service.

 

Please let me know if attached clarifies the doubt. Thanks.

 

Capture.PNG

Anonymous
Not applicable

Measure = SUMX(SUMMARIZE(Duplicate_Removal,Duplicate_Removal[NPI],"UniqNPI",AVERAGE(Duplicate_Removal[#ofService])),[UniqNPI])

 

Uniq.PNG

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.