Examples of Count, Count IF, Count duplicates in SQL

Count: SELECT [ProductModel], COUNT(1) CNT FROM [AdventureWorks2017].[Production].[vProductAndDescription] GROUP BY [ProductModel] ORDER BY CNT DESC Count "if": SELECT [ProductModel], [Name],COUNT(1) CNT FROM [AdventureWorks2017].[Production].[vProductAndDescription] WHERE [ProductModel] LIKE '%Frame' AND [Name] LIKE '%52' --here's the IF statement GROUP BY [ProductModel], [Name] ORDER BY CNT DESC Count duplicates: SELECT [ProductModel], COUNT(1) CNT -- select a field you want to … Continue reading Examples of Count, Count IF, Count duplicates in SQL

Install-WindowsFeature Web-Net-Ext failed. Source files could not be found.

Error: Trying to install .NET Framework 3.5 Features on a Windows Server 2016, either through GUI or PowerShell, returns below error (truncated): "The request to add or remove features on the specified server failed. Installation of one or more roles, role services, or features failed. The source files could not be found." Cause: .Net Framework … Continue reading Install-WindowsFeature Web-Net-Ext failed. Source files could not be found.

What and when: DateAdd vs ParallelPeriod vs SamePeriodLastYear

Reza Rad over at http://radacad.com/dateadd-vs-parallelperiod-vs-sameperiodlastyear-dax-time-intelligence-question explains the differences and provides easy usage scenarios for DateAdd, ParallelPeriod and SamePeriodLastYear DAX functions. Read his blog post to see how he reached to below conclusion: DateAdd and SamePeriodLastYear both work based on the DYNAMIC period in the filter context. ParallelPeriod is working STATICALLY based on the interval selected in the … Continue reading What and when: DateAdd vs ParallelPeriod vs SamePeriodLastYear

Power BI: The key didn’t match any rows in the table

Error: Refreshing Power BI report generates "The key didn't match any rows in the table" error. Cause: Click "Edit Queries" button. If you do not see the error message, click "Refresh Preview" button. Once you have the error message, click "Go To Error". Error message will remain, but you should have "Edit Settings" button now, … Continue reading Power BI: The key didn’t match any rows in the table