Forum Discussion
ConnieMaldonado
3 years agoResponsive Resident
Use a Matrix to Display Values - Divisor is Fixed
I am using a matrix to display values for a report that contains sales and quantity data based on Type, Category, Subtype, Line Item. Here is a link to a pbix containing mock data and my attempt at ...
- 3 years ago
ConnieMaldonado , Try a measure like
calculate(Sum(Table[Qty]), filter(all(Table), Table[Item] = max(Table[Item Type]) ))
or
calculate(Sum(Table[Qty]), filter(all(Table [Item]), Table[Item] = max(Table[Item Type]) ))
amitchandak
3 years agoSuper User
ConnieMaldonado , Try a measure like
calculate(Sum(Table[Qty]), filter(all(Table), Table[Item] = max(Table[Item Type]) ))
or
calculate(Sum(Table[Qty]), filter(all(Table [Item]), Table[Item] = max(Table[Item Type]) ))
ConnieMaldonado
3 years agoResponsive Resident
Almost there! Yay!
I was able to get Qty/Item to work for each of the Subtypes using:
Qty/Item =
DIVIDE(
sum('Sales Data'[Qty]),
CALCULATE(
SUM('Sales Data'[Qty]),
FILTER(
ALL('Sales Data'),
'Sales Data'[Line Item] = MAX('Sales Data'[Type])
&& 'Sales Data'[Subtype] = MAX('Sales Data'[Subtype])
)
)
)
However, for the total, I need to sum the quantities. If I look at just the Divisor, I get the following: