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'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
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 |
---|---|
97 | |
96 | |
82 | |
74 | |
66 |
User | Count |
---|---|
121 | |
105 | |
102 | |
82 | |
72 |