cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ashu710
Frequent Visitor

Number of Occurrence within the slicer date

Hi everyone, I wanted to make a measure that shows the number of occurrences with regard to a date slicer.

For example, if the slicer says "01-01-2022" to "30-01-2022", B=3 and A=3. Thanks for the help.

 

ashu710_0-1642441643510.png

 

1 ACCEPTED SOLUTION
v-angzheng-msft
Community Support
Community Support

Hi, @ashu710 

Try to create a measure:

Measure = CALCULATE(COUNT('Table'[ID]))

Or drag and drop into the value bucket and change the aggregation method to count

vangzhengmsft_1-1642648166003.png

 

Result:

vangzhengmsft_0-1642647911966.png

Please refer to the attachment below for details.

Hope this helps.

 

 

Best Regards,
Community Support Team _ Zeon Zheng

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-angzheng-msft
Community Support
Community Support

Hi, @ashu710 

Try to create a measure:

Measure = CALCULATE(COUNT('Table'[ID]))

Or drag and drop into the value bucket and change the aggregation method to count

vangzhengmsft_1-1642648166003.png

 

Result:

vangzhengmsft_0-1642647911966.png

Please refer to the attachment below for details.

Hope this helps.

 

 

Best Regards,
Community Support Team _ Zeon Zheng

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

edhans
Super User
Super User

I don't know how that data is A=3 and B=3. From Jan 1 to Jan 3, it is A = 2, B = 1.

 

edhans_0-1642445439002.png

edhans_1-1642445460182.png

 

To do this:

  1. Put the date in a slicer
  2. Create a Table Visual, and put the Data column (a, b, etc) in there.
  3. Create a measure:
    1. Fact Table Count = COUNTROWS('Table')

  4. It simply counts the rows within the date range.

You can see my PBIX here if you want to play with it. 

 

If you need more help, please provide more info.

How to get good help fast. Help us help you.

How To Ask A Technical Question If you Really Want An Answer

How to Get Your Question Answered Quickly - Give us a good and concise explanation
How to provide sample data in the Power BI Forum - Provide data in a table format per the link, or share an Excel/CSV file via OneDrive, Dropbox, etc.. Provide expected output using a screenshot of Excel or other image. Do not provide a screenshot of the source data. I cannot paste an image into Power BI tables.

 

 

 

 



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power BI Dev Camp Session 23 768x460.jpg

Check it Out!

Mark your calendars and join us on Thursday, June 30 at 11a PDT for a great session with Ted Pattison!

June 20 episode 7 with aka link 768x460.jpg

The Power BI Community Show

Join us on June 20 at 11 am PDT when Kim Manis shares the latest on Azure Synapse analytics, the Microsoft Intelligent Data Platform, and notable Power BI Updates from Microsoft Build 2022.

Top Solution Authors