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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

DAX - Divide Value in Column by the Count of another Column in a separate table

Hi there, 

 

I am attempting to do a simple calculation to understand the number of Keys created per headcount. Headcount values are in a column as below, and the table below shows the Count of these Keys. Therefore I would like to Divide "Count of Key" by Headcount. These columns are in separate tables and the relationship is Many:Many (default) with a Single direction (Headcount table filters Key Table) - which was done by default.

 

MrMED87_0-1606905596251.png

 

 So far all of my attempts have caused the visualisation to fail. Any help is very much appreciated. Thanks

1 ACCEPTED SOLUTION
PhilipTreacy
Super User
Super User

@Anonymous 

Your Headcount column is Text.  Change it to Whole Number.

Phil


If I answered your question please mark my post as the solution.
If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up.



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


View solution in original post

3 REPLIES 3
PhilipTreacy
Super User
Super User

@Anonymous 

Your Headcount column is Text.  Change it to Whole Number.

Phil


If I answered your question please mark my post as the solution.
If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up.



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Anonymous
Not applicable

Thanks - unfortunately i am still struggling. I have merged the query into the same table so its now a single table.

 

DAX is = DIVIDE(COUNT(Table1[Key]),SUM(Table1[Headcount]) 

 

I get the below error:

 

MrMED87_0-1606911076833.png

 

 

amitchandak
Super User
Super User

@Anonymous , difficult to tell, but better to create one or more bridge table and anayze on that.

 

Across common param

new measures = divide([Count of Key],[Headcount]) // Both are measures

 

https://www.seerinteractive.com/blog/join-many-many-power-bi/

 

 

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.