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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors