March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe 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
I have a table called Billing Info which has columns:
I would like to work out the Average GP for Fixed Monthly Rate per Year-Month.
I would need to sum the total GP per UserName per Year-Month then work out the average over that.
Example:
Solved! Go to Solution.
Hi @rush,
From the error message, column [Gauteng] is TEXT data type. And you have specify the aggregation (eg: SUM) for this column in the measure while this aggregation doesn't support TEXT values. So please check the [Gauteng], see if it can be convert to number.
By the way, you can upload your .pbix file to OneDrive or Dropbox and share the link here.
Best Regards,
Qiuyun Yu
Hi @rush,
Measure1 = IF(MAX('Table1'[BillingType])="Fixed Monthly Rate", CALCULATE(AVERAGE(Table1[GP]),FILTER(ALL('Table1'),'Table1'[BillingType]="Fixed Monthly Rate" )),BLANK())
Measure 2 = CALCULATE(AVERAGE(Table1[GP]),ALLEXCEPT(Table1,'Table1'[UserName]))
If above DAX doesn't meet your requirement, please share screenshots about the desired results for our analysis.
Best Regards,
Qiuyun Yu
Thank you @v-qiuyu-msft
It does not bring back my desired results.
Please see below of the final result:
Table desired results:
Hi @rush,
As your sample data you provided doesn't contain StaffRegion while the desired results have it, you can try the below DAX:
Measure = CALCULATE(AVERAGE(Table1[GP]),FILTER(ALL(Table1),'Table1'[Year-Month]=MAX('Table1'[Year-Month])),VALUES(Table1[StaffRegion]))
If it doesn't work, please share corresponding sample data. If possible, please share the .pbix with us.
Best Regards,
Qiuyun Yu
Hi @v-qiuyu-msft, thanks but it gives me an error on the text to type number.
I will update the sample file as I cannot share the pbix file.
It throws back an error:
Hi @rush,
From the error message, column [Gauteng] is TEXT data type. And you have specify the aggregation (eg: SUM) for this column in the measure while this aggregation doesn't support TEXT values. So please check the [Gauteng], see if it can be convert to number.
By the way, you can upload your .pbix file to OneDrive or Dropbox and share the link here.
Best Regards,
Qiuyun Yu
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
123 | |
85 | |
85 | |
70 | |
51 |
User | Count |
---|---|
205 | |
153 | |
97 | |
79 | |
69 |