Forum Discussion
Sum visible rows in matrix visual
Hi,
I have a matrix table, with multiple rows and values. I wanted to count number of products but the measure I wrote is not summing in the table nor in card visual. Rows are coming from 6 different tables.
Some of the products repeat within the country and customer, but I want to count visible number of products.
Also I tried to calculate the average of the Days past request date but it gives me very high number, so I suppose it takes data from the whole table and I wanted to have it only for the data from the table.
I would appreciate any help.
Maieev
In this case we need to force additivityCount products = SUMX ( SUMMARIZE ( 'Sales Order Details', 'Sales Structure'[Country], 'Customer Sold To'[Customer Sold To], 'Sales Order Details'[Order Number] ), COUNTROWS ( CALCULATETABLE ( VALUES ( 'Sales Order Details'[ItemDWHKey] ) ) ) )Maieev
Please tryCount products = SUMX ( SUMMARIZE ( 'Sales Order Details', 'Sales Structure'[Country], 'Customer Sold To'[Customer Sold To], 'Sales Order Details'[Order Number] ), COUNTROWS ( CALCULATETABLE ( VALUES ( 'Product'[Product ID Description] ), CROSSFILTER ( 'sales Order Details'[ItemDWHKey], 'Product'[ItemDWHKey], BOTH ) ) ) )
15 Replies
- MaieevResolver I
Sure,
Rows:
1. 'Sales Structure'[Country]
2. 'Customer Sold To'[Customer Sold To]
3. 'Sales Order Details'[Order Number]
4. 'Time - Order Entry'[Order Entry Date]
5. 'Time - Requested By'[Requested By Date]
6. 'Time -Requested By'[Days past request date] it's calculated column = DATEDIFF('Time - Requested By'[Requested By Date],TODAY(),DAY)
7. 'Product'[Product ID Description]
Values:
From 'Metrics' table, two measures:
- Request Quantity
- Request Value
and
- Count products = COUNTAX(Metrics,[Request Quantity])
It's a very big relationship model, this is a part of it, all of those are linked to Sales Order Details.