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

Group by date & filter

Hello everyone,

 

I am new using Power Bi Desktop and am struggling with something...

I have imported a database from SQL table :

Capture.PNG

Each line corresponds to the detection of a car 1way/ car 2nd way/bike/truck/pedestrians

I am now trying to display the average number of total cars+trucks, filtered by day, filtered by zone (cameraID).

The idea would be to display an "average number of cars+trucks per day in february in zone 4" for example.

 

I tryed using the group by function to make a new table with merged dates but can't make it work because of the differences between zones and type of detection.

 

Any idea how to solve this problem please ?

 

Kind regards,

 

Antoine

 
 
1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

So, use slicers for what you want to filter on. Then you need a Date column with Date and no timestamp or Date and the same timestamp. Then you should be able to use SUMMARIZE like:

 

Average Measure = 
  VAR __Table = 
    SUMMARIZE(
      'Table',
      [Date no Timestamp],
      "Count",COUNTROWS('Table')
    )
RETURN
  AVERAGEX(__Table,[Count])

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Greg_Deckler
Super User
Super User

So, use slicers for what you want to filter on. Then you need a Date column with Date and no timestamp or Date and the same timestamp. Then you should be able to use SUMMARIZE like:

 

Average Measure = 
  VAR __Table = 
    SUMMARIZE(
      'Table',
      [Date no Timestamp],
      "Count",COUNTROWS('Table')
    )
RETURN
  AVERAGEX(__Table,[Count])

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

It works ! Thanks very much for your help 🙂

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.