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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

How to create a measure that only displays one value for each row on a specific column of data

Apologies, it is a difficult question to ask so I will explain it the best I can.

I have a visual that shows the total of a column called "Quantity" from the table [Line Items], however, there is another column on the [Line Items] table called “Category”. These categories are typically “Assembly”, “Workshop”, and “Virtual”.

Here's a sample of that table [Line Items] below:

 

Line Item ID

Deal ID

Category

Quantity

Amount

1001

1004

Assembly

60

200

1002

1003

Workshop

260

550

1003

1003

Workshop

260

398

1004

1004

Assembly

60

800

1005

1003

Virtual

260

105

 

These line items are attatched to different Deals, and on every Deal I only want one quantity value (the quantity values will always be the same on a deal) as you can see above.


So, each quantity has a category. I want to write a measure that only calculates the quantity from one category rather than all 3. So, if my table visual shows a specific set of [Line Items] and it has quantity categories that are assembly and workshop, I want it to only take the quantity value from one or the other, not both.

 

So if I filter a visual that shows lineitems 1002, 1003, and 1005 that is from Deal 1003, I want the quantity to remain 260 rather than adding the quantity up. However, I still want the amount values calculated normally, so I only want the Quantity column effected. 

 

So if I was to create say an "Official Quantity" measure, how would it go?

 

Official Quantity = 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I found a way how to do it, incase anyone else needs to go, here is the measure I created: 

Official Quantity = SUMX (DISTINCT('LineItem'[quantity]), FIRSTNONBLANK ('LineItem'[quantity], 0 ))

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

I found a way how to do it, incase anyone else needs to go, here is the measure I created: 

Official Quantity = SUMX (DISTINCT('LineItem'[quantity]), FIRSTNONBLANK ('LineItem'[quantity], 0 ))
Anonymous
Not applicable

Apologies this post was marked as spam previously I'm not sure why. 

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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