Forum Discussion
mic_rys
Helper I
2 years agoHow to Sum values in the same section - including filtering
Hi, I have a problem with the DAX mesaure and I'm looking for the dax master 🙂 my table: Customer Task ID TabName FieldName Value txt Value int A 1 1_1 PromoName 1 Cars A 1 ...
- 2 years ago
hi mic_rys ,
not sure if i really get you, please try:
1) plot a slicer with data[Value txt];
2) plot a table visual with data[customer] and/or data[task ID] and a measure like:
measure = VAR _txt = SELECTEDVALUE(data[Value txt]) VAR _tabname = MAX(data[TabName]) VAR _result = CALCULATE( SUM(data[Value int]), ALL(data[Value txt]), FILTER( ALL(data[TabName]), data[TabName]=_tabname ) ) RETURN _resultit worked like:
FreemanZ
Super User
2 years agohi mic_rys ,
not sure if i really get you, please try:
1) plot a slicer with data[Value txt];
2) plot a table visual with data[customer] and/or data[task ID] and a measure like:
measure =
VAR _txt = SELECTEDVALUE(data[Value txt])
VAR _tabname = MAX(data[TabName])
VAR _result =
CALCULATE(
SUM(data[Value int]),
ALL(data[Value txt]),
FILTER(
ALL(data[TabName]),
data[TabName]=_tabname
)
)
RETURN _result
it worked like:
mic_rys
Helper I
2 years agothanks a lot! I did a little modification in the measure:
VAR _promo = SELECTEDVALUE(Tasks[Value])
VAR _section = VALUES(Tasks[Tab])
VAR _result =
CALCULATE(
SUM(Tasks[Value int]),
ALL(Tasks[Value]),
FILTER(
ALL(Tasks[Tab]),
Tasks[Tab] in _section
)
)
RETURN
_result
because can appear more than 1 tabname in one taskid and now a have another problem because in the total measure shows wrong values.
In total measure add values to taskID from the other which exists the same TabName; but not selected in the slicer (Train).
Could you help me?:)
(how to add a pbi project to the post?:))