Forum Discussion

Earkkaperk's avatar
Earkkaperk
Frequent Visitor
1 year ago
Solved

Measure in slicer

Hi guys,

 

I have an issue when I try to create calculated column as column cannot be pushed to remote data source.

So I decide to do with measure instead.

AlarmDesc = LOOKUPVALUE(AlarmCode[AlarmDesc],AlarmCode[DateText],MAX('Fact Lineloss View'[DateText]))
This to have AlarmDesc which is from AlarmDesc table lookup by date
 
Then I created another measure here
CausalMachine_new = IF([AlarmDesc]="4_05 Event Machine Top Closer Stop (Interlock)","99.Case Sealer",MAX('Fact Lineloss View'[CausalMachine]))
It works well with my table but I want this to be a slicer also.
As the measure cannot be put in slicer. So I'm stuck here.
 
Is there any workarounds to make this works?
I have tried many ways from here but it's not working as expected.
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi Earkkaperk ,

    It is true that putting Measure into Slicer is not supported in Power BI.

    But I think you have the option of using Calculated columns, which support putting themselves into Slicer and which have similar functionality to Measure.

    I create two tables as you mentioned.

    Then I create two calcualted columns.

    Alarm =
    LOOKUPVALUE (
        'AlarmCode'[AlarmDesc],
        'AlarmCode'[DateText], MAX ( 'Fact Lineloss View'[DateText] )
    )
    CausalMachine_new =
    IF (
        [AlarmDesc] = "4_05 Event Machine Top Closer Stop (Interlock)",
        "99.Case Sealer",
        MAX ( 'Fact Lineloss View'[CausalMachine] )
    )

    So you can add them into the slicer and it will give you what you want.

     

     

     

    Best Regards

    Yilong Zhou

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

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Earkkaperk ,

    It is true that putting Measure into Slicer is not supported in Power BI.

    But I think you have the option of using Calculated columns, which support putting themselves into Slicer and which have similar functionality to Measure.

    I create two tables as you mentioned.

    Then I create two calcualted columns.

    Alarm =
    LOOKUPVALUE (
        'AlarmCode'[AlarmDesc],
        'AlarmCode'[DateText], MAX ( 'Fact Lineloss View'[DateText] )
    )
    CausalMachine_new =
    IF (
        [AlarmDesc] = "4_05 Event Machine Top Closer Stop (Interlock)",
        "99.Case Sealer",
        MAX ( 'Fact Lineloss View'[CausalMachine] )
    )

    So you can add them into the slicer and it will give you what you want.

     

     

     

    Best Regards

    Yilong Zhou

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