DAX Measure to Create Unique Subtotal - dax

Is it possible using DAX in power pivot to create a measure that doesn't display in the matrix under each category but only as a subtotal? The desired output would look something like below where the measure would add subcategory A and B and divide those results by subcategory C. Highlighted row below is desired output that would be shown for each category in the matrix.

Related

Creating a measure to indicate Remarks on a multilevel matrix (2 categories) from a different table

I have a query (Excel file) of expenses categorized by location on cost category, and time period. I also have a separate query (SharePoint list) containing all these and remarks on the variances per cost category.
I want the matrix to show the expenses, with location and category on rows, and the remarks measure.
The remarks on the cost category should show the variance per cost category from the SP List. But on the location category, it should show the remarks on the cost category with the biggest variance (absolute value) in that location.
Variance is a measure, and the rest are columns.
matrix sample

How to calculate the ratio between the grand total of two metrics on Google Data Studio?

I created a table on Data Studio that shows the columns:
A: Date
B: 1st metric (number)
C: 2nd metric (number)
D: custom formula to calculate the ratio between the 1st and 2nd metric (percentage)
Then I checked the option to show the Summary Row that sums all the values of each date. But in the column D I don't want it to calculate the sum of the values in column D (nor the average of the values), instead, I want the ratio between the sum of the values of column D and C. How to achieve that?
To have the calculated field correctly in the total, you have to make sure to aggregate your calculated field. To do so, use 'sum()' in your calculation.
That would be this formula:
sum(total sales)/sum(gross sales)
I hope this answers your question!

How can I get correct totals in SSRS matrix?

The matrix below has column totals under the red line. The pivoted column group columns are highlighted in yellow to the right of the vertical red line. The columns in the white to the left are not pivoted.
So it looks like the totals under the pivoted yellow columns are correct,
but the totals under the regular columns are totally wrong.
Those are simple =Sum(Fields!columnX.Value) totals in a group total row.
Matrix design is as follows (wherever you see "Expr" it is simply that Sum multiplied by a temporarily used constant 1, except where I deleted that from pour_weight for simplicity):
It appears that SSRS totals the left columns BEFORE pivoting the right columns, which is a total disaster.
What am I doing wrong?
Ended up creating a 2nd dataset without detail columns and with the Sums of each on the remaining columns, then using a Lookup function in the matrix cells to find the correct group's correct total.

how to calculate sum of an average field in crystal report

I have a field that calculates an average per row (Avg_Amt), it gives a correct output. My problem is how can I calculate the total summary of the average field (Avg Amt) then place it to the report footer.
Thanks & Best Regards.
Create 2 formula fields one for average and one for sum and insert this formula the first one
formula = Average ({Feild Name})
in the second formula from the report fields drag and drop the average formula and add the sum operation like :
formula = SUM({#Average})
If it is a straight average, use the sum wizard to add a sum for each field, then insert a formula field see below, this will actually get you to the accurate basis points average
(Sum ({#Field_1})/Sum ({#Field_2}))*100

Formula workshop - formula editor in crystal report

I have something like this
quantuty 10,10,15,20,30
price per piece 2,2,5,7,4
I want to calculate total price for each row and sum all this
I use formula
Sum ({ESTIMATE_ITEMS.QUANTITY} * {ESTIMATE_ITEMS.PRICE_PER_PIECE} )
And I got an error mesage for this formula "A field is required here"
So what is wrong there?
Use a formula on each row that does the multiplication, then you can insert a summary summation on that formula field. In other words, take out the sum from your formula and save the formula, insert the formula as a field. Right click on the formula field and choose "insert summary" then choose "sum".

Resources