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.
Hi,
I am using direct query. I need the grant total and average to be displayed in each row. is it possible. ? i know i can do this in sql but i dont want to.
Here is an example
Col1 Col2 Sum Avg
X 100 600 200
Y 200 600 200
Z 300 600 200
Thanks
Solved! Go to Solution.
Hi @dp106,
Just see your data here, please try the formulas below.
Avg = CALCULATE ( AVERAGE ( 'table'[Col2] ), ALL ( 'Table'[Col1], 'Table'[Col2] ) )
Sum = CALCULATE ( SUM ( 'table'[Col2] ), ALL ( 'Table'[Col1], 'Table'[Col2] ) )
Best Regards,
Dale
Hi @dp106,
Could you please mark the proper answer as a solution?
Best Regards,
Dale
Hi @dp106,
You can create two measures like below.
Avg = CALCULATE ( AVERAGE ( 'table'[Col2] ), ALL ( 'table' ) )
Sum = CALCULATE ( SUM ( 'table'[Col2] ), ALL ( 'table' ) )
Best Regards,
Dale
Thanks. The solution seems to be working fine but not if i have filters (slicers on the reports).
If i add the mesaure, no matter what filters are applied in the report, all the values are pulled from the database.
Here is how the data is. i have a slicer on the report on col0 (there are couple of filters on the actual report)
Col0 Col1 Col2 Sum Avg
1 X 100 600 200
1 Y 200 600 200
1 Z 300 600 200
2 X 150 900 300
2 Y 500 900 300
2 Z 250 900 300
Thanks again for looking at it.
Just need to modify the ALL, which as you'd expect is pulling all the data, to using ALLEXCEPT and specifying Col0 as needed. It will pull through all the values in your database as is, as that's what you're telling it to do...
Thanks for your response.
I tried the solution you recommended, so the calculation works fine but it pulls are the records from the database (ignoring the slicer)
Hi @dp106,
Just see your data here, please try the formulas below.
Avg = CALCULATE ( AVERAGE ( 'table'[Col2] ), ALL ( 'Table'[Col1], 'Table'[Col2] ) )
Sum = CALCULATE ( SUM ( 'table'[Col2] ), ALL ( 'Table'[Col1], 'Table'[Col2] ) )
Best Regards,
Dale
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
95 | |
80 | |
68 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |