cancel
Showing results for
Did you mean:

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

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
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 !

3 REPLIES 3
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.

Super User

Hi,

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

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 !

Announcements

#### Power BI Monthly Update - November 2023

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

#### Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

#### Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

#### The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors