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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Anonymous
Not applicable

Divide the number of rows for a specific objective

Hi,
I have two tables that follow this structure:

Response Table

Year  Month  Type  Year-Month-Type                     
202201A2022-01-A
202201A2022-01-A
202201B2022-01-B
202202A2022-02-A
202202C2022-02-C


Objective Table

Year-Month-Type    Objective    
2022-01-A4
2022-01-B1
2022-01-C6
2022-02-A3
2022-02-B2
2022-02-C5


Each Type of response has a different objective number for each year and each month.

I already created a relationship between the Year-Month-Type columns in both tables. I want to create a measure that divides:
Count of rows from the Response Table by the objective for that year, month and Type (Objective Table):

So, based on the example tables above, the measure should show the following values :

Year 2022
Month 1 -> Type A ->  (rows in the response table) / (objective for that year-month-type) =  2/4 = 50%
Month 1 -> Type B -> (rows in the response table) / (objective for that year-month-type) = 1/1 = 100%
Month 1 -> Type C -> (rows in the response table) / (objective for that year-month-type) = 0/6 = 0%

Month 2 -> Type A ->  (rows in the response table) / (objective for that year-month-type) =  1/3 = 33,33%
Month 2 -> Type B -> (rows in the response table) / (objective for that year-month-type) = 1/2 = 50%
Month 2 -> Type C -> (rows in the response table) / (objective for that year-month-type) = 0/5 = 0%

Can someone help mep?


1 REPLY 1
parry2k
Super User
Super User

@Anonymous add a measure:

 

% = 
DIVIDE( 
   COUNTROWS ( ResponseTable ),
   MAX ( ObjectiveTable[Objective] )
)

 

In a visual, use Year-Month-Type from the objective table and above measure and that will do it.

 

 

Follow us on LinkedIn and YouTube.gif to our YouTube channel

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

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 Kudoed Authors