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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
harshagraj
Post Partisan
Post Partisan

Slicer value in calculated column

Hello all how do i assign a dynamic slicer value on a calculated column. Please see the attached.

harshagraj_0-1658300126916.png

I cant create a measure for this. Kinldy help. I just need to display 1 for the selected value from slicer.

 

1 ACCEPTED SOLUTION
Avantika-Thakur
Solution Supplier
Solution Supplier

Hi @harshagraj ,

As you are using a calculated column, we cannot use the selected value from segment code slicer in the DAX for calculated column as calculated columns work on row by row calculation and tend to give static values in each row of the table.
You might need to create a measure for dynamic filtering of the segment code in the DAX.

 

Thanks!

Avantika

View solution in original post

3 REPLIES 3
Avantika-Thakur
Solution Supplier
Solution Supplier

Hi @harshagraj ,

There is one way that we can handle this.

1) Create a separate lookup for the segment codes that you will be using in the Slicer.

Ex: I have used alphabets A-D as examples for segment codes

AvantikaThakur_6-1658302157510.png

 

2) And you will have a separate column for segment codes in Fact table as below

AvantikaThakur_3-1658302021536.png

 

3) Create a relationship between these two tables as below on the segment codes columns in respective tables

AvantikaThakur_5-1658302059346.png

 

4) And then you can create a measure like :

Measure  = IF(SELECTEDVALUE('Fact'[Segment code])=SELECTEDVALUE('Lookup'[Segment code]),1,0)
 
Hope this helps.
Please accept the solution if it answers your query.
Thanks!
Avantika

 

Avantika-Thakur
Solution Supplier
Solution Supplier

Hi @harshagraj ,

As you are using a calculated column, we cannot use the selected value from segment code slicer in the DAX for calculated column as calculated columns work on row by row calculation and tend to give static values in each row of the table.
You might need to create a measure for dynamic filtering of the segment code in the DAX.

 

Thanks!

Avantika

Hi @Avantika-Thakur thanks for the reply but the problem is cant able to create a measure for this too.I cant aggregate Segment code column.

IF(_??__(SegmentCode) =Selectedvalue(Segmentcode),1,0)

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.