Forum Discussion
Creating histogram using measure and dimension from data warehouse
- Anonymous1 year ago
Thanks for the reply from Poojara_D12 and Fowmy , please allow me to provide another insight:
Hi, Anonymous
Have the answers from Poojara_D12 and Fowmy resolved your issue? If so, please mark their responses as the solution. This will help others with similar questions find the answers more quickly.
Regarding your question, I have also created the following example:
1.Firstly, here is my sample data:
Bins = DATATABLE( "Bin", INTEGER, { {0}, {10}, {20}, {30}, {40}, {50}, {60}, {70}, {80}, {90}, {100} } )2.Secondly, I have created the following calculation table:
3.Next, I have created the following measures:
Frequency = COUNTROWS( FILTER( TestData, TestData[Value] >=MAX('Bins'[Bin])&& TestData[Value] < MAX('Bins'[Bin]) + 10 ) )4.Here's my final result, which I hope meets your requirements.
Please find the attached pbix relevant to the case.
Best Regards,
Leroy Lu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous
You can create a histogram in Power BI using DAX without exporting data. Here’s a simple way:
1. Create Ranges for the Histogram:
- Add a calculated column to your table in Power BI to define buckets/ranges. For example:
Range =
SWITCH(
TRUE(),
[Measure] <= 10, "0-10",
[Measure] <= 20, "11-20",
[Measure] <= 30, "21-30",
"31+"
)2. Build the Histogram:
- Use the Range column as the X-axis (Legend/Axis) in your chart.
- Use a measure like `Count` or `Sum` of the original values for the Y-axis.
3. Refine the Chart:
- Format your clustered column chart to show the ranges clearly.
This method avoids relying on groups or exporting data. You can adjust the ranges in the DAX formula as needed!
Did I answer your question? Mark my post as a solution, this will help others!
If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂
Kind Regards,
Poojara
Data Analyst | MSBI Developer | Power BI Consultant
Please Subscribe my YouTube for Beginners/Advance Concepts: https://youtube.com/@biconcepts?si=04iw9SYI2HN80HKS