Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

View all the Fabric Data Days sessions on demand. View schedule

Reply
Anonymous
Not applicable

Dax

Hi, I have a card and a table visual where I want to show the correct sales value. Have been stucked for few days. Hope someone can show me the solution for this...

 

For the card,

if I filter BU = BU1, I should get 42 for the sales value,

if I filter Brand = A, I should get 30,

if I filter Brand = C, I should get 30,

if I filter BU = BU1 and Brand = A, I want to get 30

 

Currently I have a problem because in the Brand filter, I will only show Brand A, B, C, D. So in order to get the correct value for the brand (e.g. Brand C), I need to check the [Group]. If the [Group] is the same, I need to sum it up.

 

For the table,

I want to show 30, 12, 30, blank for Brand A, B, C, D respectively.

beekee_3-1605805957999.png

 

Sample data

BUBrandData TypeGroupActualSales
BU1Brand: J01RedJ01 5
BU1Brand: J01 AARedJ01 10
BU1Brand: J01 ABRedJ01 15
BU1Brand: J01 CCRedJ0110 
BU1Brand ABlueJ0110 
BU1Brand: R06RedR06 2
BU1Brand: R06 AARedR06 4
BU1Brand: R06 ABRedR06 6
BU1Brand: R06 CCRedR0615 
BU1Brand BBlueR0620 
BU1Brand CBlueJ012 
BU1Brand DBlueJ089 

 

Thanks,

Bee Kee

 

 

1 ACCEPTED SOLUTION
Anonymous
Not 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))

dax.JPG

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.

View solution in original post

3 REPLIES 3
PaulDBrown
Community Champion
Community Champion

@any chance you can post some sample data (not as an image)?





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Anonymous
Not applicable

Hi Paul, I'm not sure how I can attach my excel file so I created a table within the post.

Anonymous
Not 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))

dax.JPG

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.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors