Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I have to recreate the following graph from excel in Power BI
My data looks like the following:
As you can see, I need to split up the data into blocks (e.g. 0-100, 100-200...) and then calculate the percentage of the values in each block and then graph that. I am new to Power BI and have tried playing around with it, but cannot work out how to create this graph. Thanks in advance.
Solved! Go to Solution.
Hi @Anonymous
Enter data to create a new table
Create calculated columns
bucket = SWITCH(TRUE(),[value]>=0&&[value]<1000,"1000",[value]>=1000&&[value]<2000,"2000",[value]>=2000&&[value]<3000,"3000")
Create measures
frequency = CALCULATE(COUNT('Table'[value]),ALLEXCEPT('x table','x table'[x_values]))
percentage = [frequency]/CALCULATE(COUNT('Table'[value]),ALL('Table'))
Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Refer, if this can help
https://appsource.microsoft.com/en-us/product/power-bi-visuals/WA104380776?tab=Overview
Perfect! Yep that has allowed me to create a histogram from my data, thank you. However, any idea how to change the y axis from frequency to percentage?
Hi @Anonymous
Create a calcualated column
bucket =
SWITCH (
TRUE (),
[value] >= 0
&& [value] < 100, "0~100",
[value] >= 100
&& [value] < 200, "100~200",
[value] >= 200
&& [value] < 300, "200~300",
[value] >= 300
&& [value] < 400, "300~400",
[value] >= 400
&& [value] < 500, "400~500"
)
Create measures
frequency = CALCULATE(COUNT('Table'[value]),ALLEXCEPT('Table','Table'[bucket]))
percentage = [frequency]/CALCULATE(COUNT('Table'[value]),ALL('Table'))
Hey, thanks for that! Is there anyway to have it so the x axis displays just 1000, 2000, 3000 etc. and not the 0~100, 100~200?
Hi @Anonymous
Enter data to create a new table
Create calculated columns
bucket = SWITCH(TRUE(),[value]>=0&&[value]<1000,"1000",[value]>=1000&&[value]<2000,"2000",[value]>=2000&&[value]<3000,"3000")
Create measures
frequency = CALCULATE(COUNT('Table'[value]),ALLEXCEPT('x table','x table'[x_values]))
percentage = [frequency]/CALCULATE(COUNT('Table'[value]),ALL('Table'))
Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
115 | |
99 | |
86 | |
70 | |
62 |
User | Count |
---|---|
151 | |
120 | |
103 | |
87 | |
68 |