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

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors