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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
databeast
New Member

Calculated column that changes values from slicer

Hello!

 

I need some DAX help! I have a table such as below and I need to create a calculated column called Product Group, that switches between two options, based on a filter from a single-select slicer:

Product

Sales

Product Group

A

$100

A and B

B

$500

Can be both ([A and B], or [B and C])

C

$300

B and C

 

The slicer will have only two options:

  1. A and B
  2. B and C

KPI for Sum of sales when [A and B] are selected: $600

KPI for Sum of sales when [B and C] are selected: $800

 

Thank you!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @databeast 

You can refer to following example.

Choose "Enter data" then input the data

vxinruzhumsft_0-1676339332498.png

vxinruzhumsft_1-1676339354126.png

 

Then creata a measure in table and put the Product Group column to the slicer

Measure = var a={LEFT(MAX('Table (2)'[Product Group]),1),RIGHT(MAX('Table (2)'[Product Group]),1)}
return  CALCULATE(SUM('Table'[Sales]),'Table'[Product] in a)

vxinruzhumsft_2-1676339451455.png

 

vxinruzhumsft_3-1676339457943.png

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @databeast 

You can refer to following example.

Choose "Enter data" then input the data

vxinruzhumsft_0-1676339332498.png

vxinruzhumsft_1-1676339354126.png

 

Then creata a measure in table and put the Product Group column to the slicer

Measure = var a={LEFT(MAX('Table (2)'[Product Group]),1),RIGHT(MAX('Table (2)'[Product Group]),1)}
return  CALCULATE(SUM('Table'[Sales]),'Table'[Product] in a)

vxinruzhumsft_2-1676339451455.png

 

vxinruzhumsft_3-1676339457943.png

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.