Forum Discussion
Anonymous
7 years agoNot applicable
Total All Items on Transaction that include a Specified Value
I have a table below. I want to write a dax expression to get the total of all sales that included "Alcohol" on the ticket. Any ideas? I am trying to achieve the $18.50 value. Thanks!
- 7 years ago
Try this measure:
Measure = VAR __table = SUMMARIZE('Table14',[Transaction ID],"__departments",CONCATENATEX(VALUES(Table14[Department]),[Department],","),"__sum",SUM([Net Total])) VAR __table1 = ADDCOLUMNS(__table,"__alcohol",CONTAINSSTRING([__departments],"Alcohol")) RETURN SUMX(FILTER(__table1,[__alcohol]),[__sum])
kjmullen
3 years agoNew Member
Greg_Deckler Apologies for reviving such an old thread, but I haven't been able to find a more recent example and this is almost exactly what I need. Is there a way to use department as a slicer and remove the hard-coded department reference? I've tried using SELECTEDVALUE, but that is not retuning the right values. Ideally, I'd want the slicer to be a multi select, but I can't even get a single value to return the sum I expect.