Forum Discussion
AndreaLorenzo
5 years agoFrequent Visitor
Calculate not working when using same field in table and formula filter
Hello everybody, I'm trying to do something very simple, but I can't make it work: from a Sales table, I need to compare the revenue for every product category related to another one. I've ...
AndreaLorenzo
5 years agoFrequent Visitor
Thanks for the feedback, Greg_Deckler . Calculate is a bit difficult to understand, yes.
I finally got it working, maybe is not the most elegant solution, but it will do...
H_Sales= var _tbl = ALLSELECTED(PBI_Sales)
var _catFiler= "H"
RETURN SUMX(FILTER(_tbl; PBI_Sales[CategoryID]=_catFilter); [Revenue])
Thanks!
Greg_Deckler
Community Champion
5 years agoAndreaLorenzo That's pretty much exactly how I would have done it.