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
fabianhenzler
Advocate I
Advocate I

Calculated Column/Measure to count releases per year per product

Screenshot: https://db.tt/O22dCVA5

 

As shown in the Screenshot in Dropbox, I want to create a new column that evaluates the amount of releases for a given year. So in the end I create a column for 2014, 2015, 2016, 2017, ...

Each of the columns shall contain the amount of releases per year. Each release has a complete release date.

 

I can't figure out how to create an additional column in the Products Table to show the amount of releases per year.

I need this for a KPI Card to indicate the increase or decrease regarding to the last year.

 

Thanks in advance for your help 🙂

 

1 ACCEPTED SOLUTION
BhaveshPatel
Community Champion
Community Champion

You just have to use COUNTROWS function.

 

MyMeasure:=COUNTROWS(Releases)

 

For Calculated Column for individual years, Create a Year Column in Your Releases Table using,

 

Release Year=Year(Releases[Date])

 

Create Calculated Column Using Calculate For Individual Year

 

2014 Releases=CALCULATE([MyMeasure],Releases[Release Year]="2014")

 

You can also use SWITCH Function to count all the releases in one single column.

 

For detailed information on how to use SWITCH, please refer to this blog,

http://www.powerpivotpro.com/2012/06/dax-making-the-case-for-switch/

 

 

 

Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.

View solution in original post

1 REPLY 1
BhaveshPatel
Community Champion
Community Champion

You just have to use COUNTROWS function.

 

MyMeasure:=COUNTROWS(Releases)

 

For Calculated Column for individual years, Create a Year Column in Your Releases Table using,

 

Release Year=Year(Releases[Date])

 

Create Calculated Column Using Calculate For Individual Year

 

2014 Releases=CALCULATE([MyMeasure],Releases[Release Year]="2014")

 

You can also use SWITCH Function to count all the releases in one single column.

 

For detailed information on how to use SWITCH, please refer to this blog,

http://www.powerpivotpro.com/2012/06/dax-making-the-case-for-switch/

 

 

 

Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.

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.