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

Total number of daily sales per emplyee role

Hi All,

 

So I have a scenarion that requires me to calculate the total number of "distinct transactions" per employee role.

 

eg.  I have the following role titles

         1. floor sales rep

         2. snr floor sales rep

         3. mobile sales rep

         4. snr mobile sales rep

         5. online/tele-sales rep

 

I would like to count the total number of  transactions that each role does daily.

 

I have used the following formula

 

Total Trxns per Employee Title =

Calculate(DISTINCTCOUNT( 'FACT_DAILY_SALES'[SYS_TRXN_ID]), filter('FACT_EmployeeTable',FACT_EmployeeTable[EmployeeTitle]))

 

There doesn't seem to be an error in the formula but when i add the measure to the visual I get the following error

 

<<Calculation error in measure 'Sales_Measures'[Total Trxns per Employee Title: Cannot convert 'floor sales rep" of type text to type True/False.>>

 

Would anyone here be able to assist me with a solution.

 

Thank you

1 ACCEPTED SOLUTION
serpiva64
Super User
Super User

Hi,

you can try a calculated column

Total Trxns per Employee Title  =
var currEmployeeTitle = FACT_EmployeeTable[EmployeeTitle]
var result =
Calculate(DISTINCTCOUNT( FACT_EmployeeTable[EmployeeTitle],FACT_EmployeeTable[EmployeeTitle]=currEmployeeTitle))
return
result
 

If this post is useful to help you to solve your issue consider giving the post a thumbs up 

 and accepting it as a solution !

View solution in original post

3 REPLIES 3
TJCappy
Frequent Visitor

Thanks for the suggestion,  however when I attempt it,  the formular requires that the statement

var currEmployeeTitle = FACT_EmployeeTable[EmployeeTitle]  use a measure in place of FACT_EmployeeTable[EmployeeTitle]  so unfotunately it did not work, unless I am missing something.

Hi,

are you sure of having choosen a calculated column and not a measure?

serpiva64
Super User
Super User

Hi,

you can try a calculated column

Total Trxns per Employee Title  =
var currEmployeeTitle = FACT_EmployeeTable[EmployeeTitle]
var result =
Calculate(DISTINCTCOUNT( FACT_EmployeeTable[EmployeeTitle],FACT_EmployeeTable[EmployeeTitle]=currEmployeeTitle))
return
result
 

If this post is useful to help you to solve your issue consider giving the post a thumbs up 

 and accepting it as a solution !

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.