Forum Discussion

CMoppet's avatar
CMoppet
Icon for Helper IV rankHelper IV
2 years ago

Stuck Creating a SWITCH measure

Hello 😊

 

Please can I lean on this great community again to help me with a project I am working on?  I have attached sample data to demonstrate the issue I am having:  https://drive.google.com/file/d/1BBGdvVPaE0-z0fUCAlUbuHxn3wxQnRLw/view?usp=drive_link

 

The table and chart in the document work exactly as required in most respects, where a user can slice the bar chart according to a number of different variables.  However, I am unable to get the final ‘Hard or Soft?’ slicer to work, highlighted yellow in the document.

 

In a previous post, the very helpful amitchandak advised that I may need to use the ‘SWITCH’ function to create a measure for this slicer, but I’ve watched several videos and read posts and am unsure how to apply the logic to my scenario.

 

Please can someone help me create a measure so that the ‘Hard or Soft’ slicer is functional too?  To clarify, if someone selects ‘Hard’ in the slicer, the denominator in the MTBF measure (a DIVIDE measure) should change to only count repairs where the ‘Hard or Soft’ row value is ‘Hard’.  The numerator should remain the same.

 

Many Thanks

4 Replies

  • Please explain your data model.

    Please read about normalization and star schemas.

    • CMoppet's avatar
      CMoppet
      Icon for Helper IV rankHelper IV

      lbendlin  Hello.  Thanks for taking the time to have a lookat this 🙂

      I have connected the columns that are common to both tables; Machine Brand, Type, Age Bracket, Market, Supplier.

      • lbendlin's avatar
        lbendlin
        Icon for Super User rankSuper User

        Those common columns must come from their own dimension tables.  Do not link fact tables, ever.