Forum Discussion
Slicer value in calculated column
Hello all how do i assign a dynamic slicer value on a calculated column. Please see the attached.
I cant create a measure for this. Kinldy help. I just need to display 1 for the selected value from slicer.
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
3 Replies
- Avantika-Thakur
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
- harshagraj
Post Partisan
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)
- Avantika-Thakur
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
2) And you will have a separate column for segment codes in Fact table as below
3) Create a relationship between these two tables as below on the segment codes columns in respective tables
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