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
oriabbhou1
Frequent Visitor

Divide count distinct column by non calculated column

Hi,

 

I'm doing a quick measure to divide 2 columns without doing any calculation on the denominator column.

 

So here's the scenario: The numerator column(lesson count) does a count of lessons and i have a criteria for each school. I entered the criteria(required lesson) by creating a table in powerbi and joining by school in the relationships tab. The issue is that when i try to divide lesson count(i did a count distinct on this column which is what i wanted) by required lesson, it forces me want to use some form of aggregation(sum, count, standard deviation, etc) to the required lesson column which is not want i want. I just want to divide lesson count/required lesson without the aggregation to the denominator. Is there a dax that does this perfectly? I've looked at some post but the answers i see is not working for me.

 

Please help.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@oriabbhou1 try the following 

% Completion = DIVIDE('Lessons(SQL Table)'[Count of Lesson],RELATED('Lesson Required Table'[Lesson Required]))

Karlos_0-1611499017412.png

Karlos_1-1611499026080.png

 

I've added a PBIX file to this one drive link that shows how I achieved it for you. 

https://1drv.ms/u/s!AnIEh6WhI4Jog4ginCxsERXWt36plg?e=DX9UAm 

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

@oriabbhou1 try the following 

% Completion = DIVIDE('Lessons(SQL Table)'[Count of Lesson],RELATED('Lesson Required Table'[Lesson Required]))

Karlos_0-1611499017412.png

Karlos_1-1611499026080.png

 

I've added a PBIX file to this one drive link that shows how I achieved it for you. 

https://1drv.ms/u/s!AnIEh6WhI4Jog4ginCxsERXWt36plg?e=DX9UAm 

This worked Perfect. Thanks soo much @Anonymous 

Anonymous
Not applicable

Hey @oriabbhou1 , 

Can you share a sample of the data you're working with and your desired results, please?

 

Karlos. 

iXpert_info
Helper II
Helper II

Hey @oriabbhou1 

I'd Suggest you to create a Calculated column for your solution

column=divide(table[LessonCount],table[RequiredLesson],0)

if you dont want to use above solution can you please share some sample data

Did I answer your question? If Yes, Please mark this as a solution

Best Regards
Jay Patel
iXpert Analytics

Hi @iXpert_info & @Anonymous ,

 

I tried creating a calulated column but the required lessons column from the lessons required table is not popping up as the denominator. 

Both columns are whole numbers so i dont see why it shouldnt work. I'm pretty much trying to accomplish the % completion colum in the sample data below.

 

Here's my sample data below:

 

nets question.PNG

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.