Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Anonymous
Not applicable

Dynamic value frequency based on date - is it possible?

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/21blue
1/2/22red
1/3/22green
2/19/22red
2/24/22purple

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.  

1 ACCEPTED SOLUTION
AllisonKennedy
Super User
Super User

@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. 


Please @mention me in your reply if you want a response.

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

View solution in original post

1 REPLY 1
AllisonKennedy
Super User
Super User

@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. 


Please @mention me in your reply if you want a response.

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.