Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago

Segments using DAX

Hello,

I was trying to create quadrants using DAX on Salary and I was successful with it but when I apply a country filter, it doesn't adjust based on the selection and gives me only 1 segment.

I'd like to see the DAX show 4 segments of the quadrant even with the country selection.

Here's the DAX code:

Segment =
VAR _MaxMin =
DIVIDE(
    MAX('Active employee list Global'[Total_Base_Pay_Annualized_EUR_-_Amount]) - MIN('Active employee list Global'[Total_Base_Pay_Annualized_EUR_-_Amount]), 4)
RETURN
IF('Active employee list Global'[Total_Base_Pay_Annualized_EUR_-_Amount] <= _MaxMin, "Q1",
IF('Active employee list Global'[Total_Base_Pay_Annualized_EUR_-_Amount] <= _MaxMin * 2, "Q2",
IF('Active employee list Global'[Total_Base_Pay_Annualized_EUR_-_Amount] <= _MaxMin * 3, "Q3",
IF('Active employee list Global'[Total_Base_Pay_Annualized_EUR_-_Amount] <= _MaxMin * 4, "Q4"))))

without Country Selection:


With Country Selection:

Any help on this would be really helpful.

Regards,
Mahesh

4 Replies

  • Hi,

    Please correct me if I misunderstood, but [Segment] that you created above is calculated column, am I right?

    If it is a calculated column, it will not work dynamically based on the selection of the country.
    If you can try to create that as calculated measure, I believe it will works dynamically.

    Thank you.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hello Jihwan_Kim ,

      Yes, it's a calculated column. It can't be done in a measure as I'd need them to be labelled and used as an Axis.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi All,

     

    I'd need this segmentation done based on Country i.e., if I select India, I'd need to see all 4 quarters for India. If no selection is made, I should see the plotting on Global level.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Thank Jihwan_Kim  for your prompt reply.

    Hi Anonymous  ,

    Based on the information you have provided, can you provide some example data such as detailed data (without sensitive information) and your desired output. This would allow us to better reproduce and solve the problem you are experiencing.

     

    How to Get Your Question Answered Quickly - Microsoft Fabric Community

    If it does not help, please provide more details with your desired out put and pbix file without privacy information.

     

    Best Regards,

    Ada Wang

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