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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Luuu
New Member

the measure cannot be used as the X-axis value

Spoiler
 

Luuu_0-1694401384121.png

I want to use the result (S,A,B..)of the conditional function as the x-axis, but it is not possible because it is dynamic. I tried using calculated column, but there were differences between the results and the measure.

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @Luuu ,

I created some data:

vyangliumsft_0-1694575103280.png

 

Since the chart must present the meaning of the logical relationship between the data, the data must be grouped according to certain standards (dimensions), and then various aggregation operations are performed. This is the fundamental reason why the measurement value cannot be used as the axis of the chart.

You can create a table and use the measure+if function to make a judgment.

 

Here are the steps you can follow:

1. Enter table – create a  table.

vyangliumsft_1-1694575103285.png

2. Create measure.

Measure =
SWITCH(
    TRUE(),
    MAX('Table'[Group])="S",COUNTX(FILTER(ALL(Value_Table),[average daily consumption]>=30000),[average daily consumption]),
    MAX('Table'[Group])="A",COUNTX(FILTER(ALL(Value_Table),[average daily consumption]>=10000&&[average daily consumption]<30000),[average daily consumption]),
    MAX('Table'[Group])="B",COUNTX(FILTER(ALL(Value_Table),[average daily consumption]>=3000&&[average daily consumption]<10000),[average daily consumption]),
    MAX('Table'[Group])="C",COUNTX(FILTER(ALL(Value_Table),[average daily consumption]>=1000&&[average daily consumption]<3000),[average daily consumption]),
    COUNTX(FILTER(ALL(Value_Table),[average daily consumption]<1000),[average daily consumption]))

3. Result:

vyangliumsft_2-1694575139681.png

 

 

Best Regards,

Liu Yang

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

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi  @Luuu ,

I created some data:

vyangliumsft_0-1694575103280.png

 

Since the chart must present the meaning of the logical relationship between the data, the data must be grouped according to certain standards (dimensions), and then various aggregation operations are performed. This is the fundamental reason why the measurement value cannot be used as the axis of the chart.

You can create a table and use the measure+if function to make a judgment.

 

Here are the steps you can follow:

1. Enter table – create a  table.

vyangliumsft_1-1694575103285.png

2. Create measure.

Measure =
SWITCH(
    TRUE(),
    MAX('Table'[Group])="S",COUNTX(FILTER(ALL(Value_Table),[average daily consumption]>=30000),[average daily consumption]),
    MAX('Table'[Group])="A",COUNTX(FILTER(ALL(Value_Table),[average daily consumption]>=10000&&[average daily consumption]<30000),[average daily consumption]),
    MAX('Table'[Group])="B",COUNTX(FILTER(ALL(Value_Table),[average daily consumption]>=3000&&[average daily consumption]<10000),[average daily consumption]),
    MAX('Table'[Group])="C",COUNTX(FILTER(ALL(Value_Table),[average daily consumption]>=1000&&[average daily consumption]<3000),[average daily consumption]),
    COUNTX(FILTER(ALL(Value_Table),[average daily consumption]<1000),[average daily consumption]))

3. Result:

vyangliumsft_2-1694575139681.png

 

 

Best Regards,

Liu Yang

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

 

amitchandak
Super User
Super User

@Luuu , You need use dynamic segmentation using independent or disconnected table

 

refer one of the ways

 

Dynamic Segmentation, Bucketing or Binning: https://youtu.be/CuczXPj0N-k

Dynamic segmentation -Measure to Dimension conversion: https://youtu.be/gzY40NWJpWQ

Customer Retention with Dynamic Segmentation, New/Lost/Retain Customer Count: https://youtu.be/EyL7KMw877Q

Power BI ABC Analysis using Window function, Dynamic Segmentation: https://youtu.be/A8mQND2xSR4

 

 

Dynamic Segmentation Bucketing Binning
https://community.powerbi.com/t5/Quick-Measures-Gallery/Dynamic-Segmentation-Bucketing-Binning/m-p/1...

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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