Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin 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.
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.
Solved! Go to Solution.
Hi @Luuu ,
I created some data:
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.
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:
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
Hi @Luuu ,
I created some data:
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.
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:
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
@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...
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
80 | |
76 | |
60 | |
36 | |
33 |
User | Count |
---|---|
91 | |
60 | |
59 | |
49 | |
45 |