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
abalgir
Helper I
Helper I

Count number of rows per Month

Hello,

 

I am new to Power BI and trying to do the following:

 

I have a table loaded from Postgres db. The table lists rows with each row having a booking date with the following format (UTC) :

2019-01-19 17:09:38 and a status field

 

I am trying to get a simple measure : count number of rows with status="NEW" grouped by month (Jan, Feb, Mar,...Dec).

 

I read several answers and none really worked.

 

=MONTH(_AllDataRaw[origin_trx_booking_time_stamp]) 

gives me a numeric 1, however I do not know how to convert 1 to Jan.

 

I saw an answer to use FORMAT in order to get the month as Jan, Feb,...

 
= FORMAT(MONTH(_AllDataRaw[origin_trx_booking_time_stamp]),"MMM")
 
however it returns Dec for the date 2019-01-19 17:09:38 !!!
 
I am trying to achive something like this:
 
Month       #Trx
Jan             15
Feb             76
Mar             10
 
Any help is appreciated.
 
Thank you
 
 
1 ACCEPTED SOLUTION
Anonymous
Not applicable

The easiest way to achieve what you want to do is to create a Table visual (Table or Matrix) that shows your months on a row by row basis.  The data value can then just be whichever column you want to count.  The visual filter would be on the column that contains the "=new".

 

Putting all of those contexts together you will get a count of new per month.

 

If you don't have the month information handy, a "Date Table" will likely be your solution there.  A quick google search of creating a date table should give you the code you can copy in for that part of the soultion.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

The easiest way to achieve what you want to do is to create a Table visual (Table or Matrix) that shows your months on a row by row basis.  The data value can then just be whichever column you want to count.  The visual filter would be on the column that contains the "=new".

 

Putting all of those contexts together you will get a count of new per month.

 

If you don't have the month information handy, a "Date Table" will likely be your solution there.  A quick google search of creating a date table should give you the code you can copy in for that part of the soultion.

Thank you i will search and test this

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.