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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Counting corresponding values

Hi,

 

I am in need of writing a measure which follows:

 

I work for a car rental company and have three different services, so service A, service B, and service C. When a customer buys one of the services, the database registers it with a "buying id". So what I need to create is a measure that tells me how many buying id`s are connected/registered to service A, service B, and service C. 

 

In my PBI file I have column with each of the three services, and a column with buying id. So, when a customer has bought a specific service, the next column with buying id will have a series of numbers that tells me the service was actually bought. When a buying Id is not present, and the field is blank, it simply tells me that the customer chose not to buy the service because there is no buying id present. 

 

I am hoping this makes sense, and that you can help me create a measure that tells me: How many booking id`s are registered to service A, service B, and service C. 

 

So it would be something along the lines of: "Count how many booking id`s are present for service A, service B, etc."

 

If I simply count the rows where a booking ID is present, it will not give me information on what service is connected to the booking ID. What I am wanting to create is a measure telling me how many of our sales (booking ID) can be attributed to service A, service B, and service C.

 

Hoping for help! 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

I created a sample pbix file (see attachment) for you, please check whether that is what you want.

yingyinr_0-1615798861511.png

If the above measure is not working for your scenario, please provide some sample data (exclude sensitive data) and expected result with sample or screenshot. Thank you.

Best Regards

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @Anonymous ,

I created a sample pbix file (see attachment) for you, please check whether that is what you want.

yingyinr_0-1615798861511.png

If the above measure is not working for your scenario, please provide some sample data (exclude sensitive data) and expected result with sample or screenshot. Thank you.

Best Regards

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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