Forum Discussion
Dax
- Anonymous5 years ago
Hi Anonymous ,
First, you can create a calculated column to get only Brand A, B,C and D. Then create a measure to get the sum of sales. You can find all details in the attachment.
Nbrand = IF(IFERROR(SEARCH(":",'Sales'[Brand]),0)=0,'Sales'[Brand],BLANK())Total sales = VAR _selBrand=SELECTEDVALUE('Sales'[Nbrand]) VAR _group=CALCULATE(MAX('Sales'[Group]),FILTER('Sales','Sales'[Brand]=_selBrand)) RETURN CALCULATE(SUM('Sales'[Sales]),FILTER(ALL('Sales'),'Sales'[Group]=_group))Best Regards
Community Support Team _ Rena Ruan
If this post helps, then please consider Accept it as the solution to help the other members find it more.
any chance you can post some sample data (not as an image)?
Hi Paul, I'm not sure how I can attach my excel file so I created a table within the post.
- Anonymous5 years agoNot applicable
Hi Anonymous ,
First, you can create a calculated column to get only Brand A, B,C and D. Then create a measure to get the sum of sales. You can find all details in the attachment.
Nbrand = IF(IFERROR(SEARCH(":",'Sales'[Brand]),0)=0,'Sales'[Brand],BLANK())Total sales = VAR _selBrand=SELECTEDVALUE('Sales'[Nbrand]) VAR _group=CALCULATE(MAX('Sales'[Group]),FILTER('Sales','Sales'[Brand]=_selBrand)) RETURN CALCULATE(SUM('Sales'[Sales]),FILTER(ALL('Sales'),'Sales'[Group]=_group))Best Regards
Community Support Team _ Rena Ruan
If this post helps, then please consider Accept it as the solution to help the other members find it more.