Forum Discussion
Tiger2514555
Helper III
2 years agoSELECTEDVALU matrix total some BLANK
I don't understand why when there are values in more than one column the values are returned as BLANK, but if there are only one column the values are returned correctly. My DAX: Wee...
vanessafvg
Community Champion
2 years agoif you can provide some sample data with and example of your expected result then it will be easier to help you.
Tiger2514555
Helper III
2 years agoI have the same product but the DemandID is different. I want to compare volumes to see how much they increased or decreased using Week Num Create as a basis. Right now I'm using the most recent week and the previous week. Now I can get it to display correctly in the weekly column. But the total field is not displayed correctly. I want the correct total to be displayed.
My DAX use now:
Week By Week =
VAR FilteredTable =
FILTER(
'DemandSummaryAPS',
'DemandSummaryAPS'[demandID] = 'DemandSummaryAPS'[demandID] &&
'DemandSummaryAPS'[item] = 'DemandSummaryAPS'[item] &&
'DemandSummaryAPS'[Week Num Due] = 'DemandSummaryAPS'[Week Num Due] &&
'DemandSummaryAPS'[demandID] <> BLANK()
)
VAR _max_demand_id =
MAXX(FilteredTable, 'DemandSummaryAPS'[demandID])
VAR _min_demand_id =
MINX(FilteredTable, 'DemandSummaryAPS'[demandID])
VAR _max_week_num =
MAXX(FilteredTable, 'DemandSummaryAPS'[Week Num Create])
VAR _min_week_num =
MINX(FilteredTable, 'DemandSummaryAPS'[Week Num Create])
VAR MaxWeekNumCreate =
SUMX(
FILTER(
FilteredTable,
'DemandSummaryAPS'[Week Num Create] = _max_week_num
),
'DemandSummaryAPS'[quantity]
)
VAR MinWeekNumCreate =
SUMX(
FILTER(
FilteredTable,
'DemandSummaryAPS'[Week Num Create] = _min_week_num
),
'DemandSummaryAPS'[quantity]
)
VAR SUM_Week_By_Week =
IF(
_max_demand_id = _min_demand_id,
SUMX(
VALUES('DemandSummaryAPS'[item]),
MaxWeekNumCreate - MinWeekNumCreate
),
0
)
RETURN
SUM_Week_By_Week
vanessafvg
vanessafvg