The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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...