Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
I'm trying to calculate an average, per person, per day, however the formula is returning invalid an result.
Here's the formula that I use:
_Avg Invoices per Day = CALCULATE( DIVIDE( COUNT('Billing Stats'[WO#]), DISTINCTCOUNT('Billing Stats'[DateInvoiced]), 0 ) )
and this is the data:
In the example above, 195, 114, 84 are the amounts of invoices each person created for an entire month.
195/20 is not 20, 84 / 20 does not equal to 5, etc. I'm thinking that my calculation is off, because the formula takes the billing days count per person, which could differ from one to another. So I basically need to mod my formula to calculate the average based on a total billing days overall, not by how many days someone particular billed for. I hope this makes sense.
I tried to tweak the formula to the one below, but I got an error stating that a table of multiple values was supplied where only one is expected:
_Avg Invoices per Day = CALCULATE( DIVIDE( COUNT('Billing Stats'[WO#]), CALCULATE( DISTINCTCOUNT('Billing Stats'[DateInvoiced]), FILTER('Billing Stats', ALLSELECTED('Billing Stats'[DateInvoiced])) ), 0 ) )
This is what my data table looks like:
First, I can't fathom the CALCULATE in your first formula. You can get rid of it. Second, I imagine that your issue is that you want the number of billing dates to remain constant (20) but you have a measure so it is taking context into account for how many billing days there are. This is why your total is correct but not your individual rows. Try something like:
_Avg Invoices per Day = DIVIDE( COUNT('Billing Stats'[WO#]), CALCULATE(DISTINCTCOUNT('Billing Stats'[DateInvoiced]),ALL('Billing Stats')), 0 )
This will count all of the billing days each time the measure is calculated, removing any other context.
It's still giving me inaccurate data
Hi @Anonymous,
I think you have add some additional filter on visual level or page level, right?
If this is a case, please share the sample pbix file to test, it will be help for analysis.
Regards,
Xiaoxin Sheng
User | Count |
---|---|
124 | |
108 | |
99 | |
62 | |
62 |
User | Count |
---|---|
137 | |
115 | |
102 | |
71 | |
61 |