Posts

SQL Server Store Procedure With Parameter In Power BI

Image
               SQL Server Store Procedure With User Parameter In Power BI Overview                      Sometimes, there is a situation when we need to get the data by consuming SQL Server Stored Procedure. SQL Server Stored Procedures have parameters that we need to pass dynamically.   Power BI provides functionality to execute a Store Procedure using Manage Parameters.   In this blog, we have look about the following. How to create Manage Parameter How to pass manage parameter to a Stored Procedure Invoke Query Result and load data to Power BI Desktop Limitation   This feature will work only for Import Mode in Power BI Example                  I have a procedure in SQL Server its named “spGetEmpbyGenderandDepartment” it  has two parameters named “Gender” and “Depart”. I want to use this procedure and load the data into Power BI Desktop.    So, now let’s get started! Step 1 - Create Manage Parameter in Power BI Desktop Open Power BI Desktop and from Home tab, select “Edit Queries”.  

Power BI Import Mode and Direct Mode

Image
 

Aggregate Functions in MySQL

Image
  SUM, COUNT, MIN, MAX, AVG AND STRING FUNCTIONS - UCASE, FORMAT                                     CONCAT,CHAR_LENGTH and LEFT FUNCTIONS  SELECT count(*) from employee; -- Here we use COUNT how many employee If we need count of Manager SELECT count(*) Manager FROM employee WHERE job_Desc ="Manager"; -- Average function SELECT avg (salary) FROM employee WHERE Job_Desc ="manager";   -- SUM function select sum(salary) from employee where Job_Desc="Analyst";   -- MAX and MIN function select MAX(SALARY) from employee;   select MIN(SALARY) from employee;   -- STRING -- UCASE function for UPPER CASE select  ucase(ename) Name,salary   --- Here we used Alias name from employee;   -- We can count the character in Name column for that Char_Length function select ename,char_length(ename) No_Character from employee;   -- Here we use CONCAT function ,CONCAT mean join  /* Here before the salary i wan