Count data under a pivot row in excel - excel-pivot

I have a pivot table with different types of Accounts and I need to get a calculated field where the formula would be the sum of the account/Total count under the row header.
Example in the attached image - Data Type1 and 2 are two different account types and I need to count the total rows under Data Type 1, Data Type 2 and so on so that for Data Type 1 my answer is (65,641/8)=8,205 and for Data Type 2 it is (75,626/9)=8,403. {8=count(A:H); 9=count(I:Q)}. Here I have counted manually but is there a way I can do it using some formula as this will be dynamic range and every time I will not have 8/9 sub-rows.

Related

Group 10 columns of data to gain distinct count of rows Power BI

I'm trying to display all of the distinct values within this table (there are many other columns in this table) and show how many rows each distinct value shows in.
I have tried to use group by but this does not work. It needs to be filterable by country from another column but i can do that by page filter.
I am trying to show what the top 5 associations are in terms of appearance.
enter image description here
Put the 10 columns in a Table visual. Then create this measure and add it too. Then sort descending on Distinct.
Distinct = COUNTROWS('Your Table Name')
To see only the Top 5, go to the Filter pane, and pick the first column and set the Filter type to Top N, and then Top 5 by the Distinct measure.

PowerBI: Multiply total with %share in another table

I have a measure that calculates the total for a certain account number among numerous accounts: Total EUR Account1 = CALCULATE('GL '[Total EUR], Account[Account number]="1") and then put in a table to show cost per financial quarter:
Table 1
Also; an example of source data:
Source data
Now, this sum per quarter I want to split into four different categories based on another table:
Table 2
So I want to get the below table where the % share per Category and FQ has been multiplied by the total for the applicable FQ.
I do not have the categories in the source data for the main table (Table 1)
Table 3

Create Table with a columns is a sum from values from other tables

I'm "bugging" to transform my datas to something usable.
For the moment, a datasource provides me a table where a column contains dates, following by 24 columns representing each hours. In this 24 columns, for each date (each row) I've a total of phone calls.
I want to show the hourly repartition. So, my original datasource is not really usable ans need to transform it with something where there is a column "hour" (a simple index from 0 to 23 or 1 to 24) and a column with the total call for each column from the original column. But I'm a lot confused to do it because I don't have a way to create a relationship. Like this :
Someone have any idea to help me? Thanks in advance
I would unpivot the data source and then create two dimensions (Calendar) and (Time).

Return TOP 5 values in column by category

I'm looking for good solution to be able to present on a table visual in Power BI TOP 5 highest values out of column X in table, grouped by User name in column Y of the same table.
So for each distinct user in column Y I need to show top 5 values in column X in descending order.
You can get the Top 5 details by using the RANKX function:
Rank = RANKX(CALCULATETABLE(Table,ALLEXCEPT(Table,Table[Column Y])),Table[Column X],,DESC,DENSE)
The above calculation will give you the dense rank. If you want the normal ranking use "skip" instead of "dense". Once the rank is calculated, you can filter the rank value for <=5 and you should be able to get the desired output.

sap hana calculated column check for multiple IDs

i want to create a calculated column, which will show two values: Y or N
2 columns are here important, "VAT-ID" and "CUSTOMER-ID". the calculated column will check if a customer-ID has multiple VAT-IDs. If yes the value "Y" should be displayed, else "N".
for example, the first 5 rows of the customer-id column are:
123456
654321
666666
123456
654321
the first 5 rows of the VAT-id column are:
EE999999999
AA999999999
GG999999999
KK999999999
AA999999999
the first 5 rows of the calculated column should be then:
Y
N
N
Y
N
any Help would be appreciated
Calculated columns don’t allow for aggregations across groups or other than the current row.
What you can do to achieve your goal is to create a separate aggregation node and count distinct VAT-IDs grouped by CUSTOMER-ID.
With this, you can now have a calculated column that checks for VAT-ID-COUNT > 1 and map it to your Y/N values.
As Lars mentioned it is not possible to use a window function within a calculated field on HANA table
But you can use following query to check if VAT number is multiple for a customer or not
select
CustomerId, VATID,
case
when (count(*) over (partition by CustomerId, VATID)) > 1
then 'Y'
else 'N'
end
from CustomerVAT;