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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
Maheshguptaz
Helper III
Helper III

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:

Maheshguptaz_0-1715837212606.png


With Country Selection:

Maheshguptaz_1-1715837242144.png

Any help on this would be really helpful.

Regards,
Mahesh

4 REPLIES 4
Anonymous
Not applicable

Thank @Jihwan_Kim  for your prompt reply.

Hi @Maheshguptaz  ,

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.

Maheshguptaz
Helper III
Helper III

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.

Jihwan_Kim
Super User
Super User

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.

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

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.

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

Check out the October 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

Find out what's new and trending in the Fabric Community.