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
Idlehands
Regular Visitor

Get Total of instances per month and Rank them

Hi All,

 

I am new to PowerBI so please excuse me several of my terms are hard to understand.

So what I am trying to do is get the monthly count of a specific issue from a table.  For example, Issue1 appeared 24 times in January and then 3 times in Feb, while Issue 2 appeared 3 times in Jan and then 4 times in Feb.  Then I would like the data to be displayed this way on a table:

 

                 January         February

Issue1           24                 3

Issue2           3                   4

 

I do have a table that has the Date and the Issue name and was wondering what the procedure would be to show the data in that way.

 

A follow up concern that I have is ranking the results for the above mentioned table.

 

Thanks everyone for your help!

1 ACCEPTED SOLUTION
v-huizhn-msft
Employee
Employee

Hi @Idlehands,

For your requirement, please create calculated the column to recognize month, and calculate the count of name in each month. Then create a matrix shows what you want. I try to reproduce your scenario and get expected result.


First, I create the following sample date.

1.PNG

 

Then create several calculated column using the formulas below.

Month = MONTH(Table1[Date])

Times = CALCULATE(COUNTA(Table1[Name]),ALLEXCEPT(Table1,Table1[Month],Table1[Name]))

Rank1 = RANKX(FILTER(Table1,Table1[Month]=EARLIER(Table1[Month])),Table1[Times],,ASC,Dense)

 

Finally, create a matrix, select the Name as Row level, the Month as columns level, the calculated columns as Values level, please see the following screenshots. The there are 3 issue1 times, 3 issue2 times in Jan, and rank them. While there are 3 issue1 times, 2 issue2 times in Feb, and rank them.

 

2.PNG3.png

   
If you have any other issue, please feel free to ask.

 

 

Best Regards,
Angelia

View solution in original post

4 REPLIES 4
v-huizhn-msft
Employee
Employee

Hi @Idlehands,

For your requirement, please create calculated the column to recognize month, and calculate the count of name in each month. Then create a matrix shows what you want. I try to reproduce your scenario and get expected result.


First, I create the following sample date.

1.PNG

 

Then create several calculated column using the formulas below.

Month = MONTH(Table1[Date])

Times = CALCULATE(COUNTA(Table1[Name]),ALLEXCEPT(Table1,Table1[Month],Table1[Name]))

Rank1 = RANKX(FILTER(Table1,Table1[Month]=EARLIER(Table1[Month])),Table1[Times],,ASC,Dense)

 

Finally, create a matrix, select the Name as Row level, the Month as columns level, the calculated columns as Values level, please see the following screenshots. The there are 3 issue1 times, 3 issue2 times in Jan, and rank them. While there are 3 issue1 times, 2 issue2 times in Feb, and rank them.

 

2.PNG3.png

   
If you have any other issue, please feel free to ask.

 

 

Best Regards,
Angelia

Thanks!

I will try this out later and will let you know if it worked.

 

Thanks!

Hi @Idlehands,

Waiting for your information. If the reply help you resolve your issue, please mark the corresponding as answer. If you have any other problem, please let me know.

Best Regards,
Angelia

That did the trick!

Thanks a lot!

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.