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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
mwalden
Frequent Visitor

Dividing a number on a Visualization Table when the data is imported.

Hello!!

 

I have this table below and I was able to divide Total Emails by Headcount to get Emails Per Person in Transform Data (see table 1A below.). However, Total Calls Answered was importanted by linking to a different Dataset - I am not able to manipulate this data at all. When I got to table it says the following: 

Example.PNG

 

Does anyone know if there is a way to get around this and divide totall Calls Answered by Headcount on the table?

 

When I try to divide nanswered by headcount - headcount does not show up.

Capture.PNG

Table 1A.

Picture1.png

4 REPLIES 4
AllisonKennedy
Super User
Super User

@mwalden  I don't think the import / not import is the issue here, but rather aggregate function or not. 

 

You can't divide by a column within a measure without using an aggregate function. 

 

Try the following measures:

 

Total Emails = SUM ( Fact[Emails] )

Total Headcount = SUM (fact[employee ) 

OR 

Total Headcount = DISTINCTCOUNT (fact[employeeid] ) 

 

Total Emails per person = DIVIDE ( [Total Emails] , [Total Headcount] )

 

If that doesn't work, can you provide a screenshot of your model / relationships view please?


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

@AllisonKennedy 
OK so I am getting closer thanks to your help!!

Here is the issue now, I cannot get Total Headcount to match the correct headcount. I also can't get the fact to work for it. 

 

Here is what I have right now and it gives me too many headcount. SEe the table below that shows what the headcount should be. 

exapmple of SUM.PNGWrong total headcount.PNG

This is what happens when I add fact to it:

Fact example.PNG

 

The problem is that I have a a table that shows the headcount - can I create a measure that just outputs the numbers that are in the table???

Count gets me closer to the better number

 

better count.PNG

@mwalden  - what's the 'Correct Headcount' coming from? Is it a column or measure? You should be able to use that in your divide. 

 

The 'fact' was just my placeholder for the table name, so you can ignore that part of it-  sorry for confusion. 


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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