Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I've been working on this for a couple of days now and I'm at the point where I need a reality check.
I want to be able to create a chart that shows the frequency of a column value within a selected date range. It seems like it's possible, but I just can't figure out how to do it.
Take this table for example:
Date | Color |
12/2/20 | red |
9/2/21 | blue |
1/2/22 | red |
1/3/22 | green |
2/19/22 | red |
2/24/22 | purple |
The report has a slicer for the date. Can I create a chart that dynamically counts the frequency of each color for the date range selected in the slicer?
I want the chart to have the dates on the X-axis and the frequency of each color on the Y-axis. The use case is to be able to see the number of times a color has been used in any selected date range, but only for that date range.
Any help is appreciated.
Solved! Go to Solution.
@Anonymous This can work, but you'll get 1 for every date with your sample data. Do you have a DimDate table?
https://excelwithallison.blogspot.com/2020/04/dimdate-what-why-and-how.html
You could put for example Month in the Axis, Color in the Legend, and then create a measure:
Frequency of Color = COUNT( Table[Color] )
and put that in Values to display the frequency on the Y axis.
Then use your date slicer to change the date range.
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
@Anonymous This can work, but you'll get 1 for every date with your sample data. Do you have a DimDate table?
https://excelwithallison.blogspot.com/2020/04/dimdate-what-why-and-how.html
You could put for example Month in the Axis, Color in the Legend, and then create a measure:
Frequency of Color = COUNT( Table[Color] )
and put that in Values to display the frequency on the Y axis.
Then use your date slicer to change the date range.
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
72 | |
72 | |
38 | |
31 | |
27 |
User | Count |
---|---|
92 | |
50 | |
44 | |
40 | |
35 |