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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Sum column in measure, ignoring other columns

Dear all,

 

I have a column in my table which i want to be summed on a unique row, but it needs to ignore the 'code' column. So when summing instantly it returns 10. but I need it to be two, since City is changing as well, but this needs to be taken into account.

 

IDTYPECodeCityType_IDYearSum
AR!625NYR1-A20231
AR!545NYR1-A20231
AR!126NYR1-A20231
AR!120NYR1-A20231
AR!116NYR1-A20231
AR!625LAR1-A20231
AR!545LAR1-A20231
AR!126LAR1-A20231
AR!120LAR1-A20231
AR!116LAR1-A20231
1 ACCEPTED SOLUTION
v-alq-msft
Community Support
Community Support

Hi, @Anonymous 

 

Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.

Table:

b1.png

 

You may create a measure as below.

Sum = 
COUNTROWS(
    SUMMARIZE(
        'Table',
        'Table'[ID],
        'Table'[City]
    )
)

 

Result:

b2.png

 

Best Regards

Allan

 

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

3 REPLIES 3
v-alq-msft
Community Support
Community Support

Hi, @Anonymous 

 

Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.

Table:

b1.png

 

You may create a measure as below.

Sum = 
COUNTROWS(
    SUMMARIZE(
        'Table',
        'Table'[ID],
        'Table'[City]
    )
)

 

Result:

b2.png

 

Best Regards

Allan

 

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

amitchandak
Super User
Super User

@Anonymous , is it not, distinct count of the city ?

 

a new measure

distinctcount(Table[City])

Anonymous
Not applicable

the result is 2 yes, but lets say my table in real is much longer with different ID in same city

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.