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
shrungahv
New Member

Formula to create a new column to get the count of a row with same value/data for a particular month

Hi, Need your help. I am trying to achieve to create a new cloumn in Power BI with formula to get the count of same asset received for a particular month (expected result Column highlighted in Yellow) 

Below is the formula am applying but not returning the correct count. Please can someone help.

 

Asset count = var ast = [Asset] var mnt = [Month] return countrows(filter(filter(Query1, [Asset] = ast), [Month] = mnt))

Query1 is the table name
 

sample.JPG

2 REPLIES 2
ITGeek555
Helper II
Helper II

You could just create a measure

Asset Count = COUNTROWS(TableName)

and then put Asset, Month and Asset Count fields in a table visual

@ITGeek555Thanks for the response. I used the below Measure and it is giving the correct count but subtotal is not displaying correct.

AssetCountGreaterthan = IF(Query1[AssetCount] >= 3, Query1[AssetCount], BLANK())

i have 4 categories under the Matrix Row (Client Name, Asset Name, country, service line) when drill down to Asset Name it is showing 2 asset (asset1 and asset2 with 5 and 4 count respectively however under Client Name subtotal display 28 which should actually show to Subtotal as 9.
 
 
 
 
 

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.