Posts

Showing posts with the label GENERATE

Differences between GENERATE and CROSSJOIN - Unplugged #37

https://www.sqlbi.com/tv/differences-between-generate-and-crossjoin-solving-business-scenarios-unplugged-37/   Solution: - Create temporary table of AvailableSkills which includes each employee's skills and level and rows for any level that is less than the employee's skill level - Create a temporary table of the RequiredSkills for each job requisition - INTERSECT RequiredSkills and AvailableSkills to get the list of employees who have the minimum skill level for each skill in the job requisition MS3 = VAR AvailableSkills = SELECTCOLUMNS ( GENERATE ( SUMMARIZE ( EmployeeSkills , Skills[Skill Name] , EmployeeSkills[Level] ), FILTER ( SELECTCOLUMNS ( ALLNOBLANKROW ( EmployeeSkills[Level] ), "@Level" , EmployeeSkills[Level] ), EmployeeSkills[Level] >= [@Level] ) ), "Skill Name" , [Skill Name] , ...

Writing a DAX query using TOPN

  https://www.youtube.com/watch?v=tgL7D3JTa_E

Using GENERATE and ROW instead of ADDCOLUMNS in DAX

  https://www.youtube.com/watch?v=AieQMS6rGvM https://www.sqlbi.com/articles/using-generate-and-row-instead-of-addcolumns-in-dax/   Preferred solution: Calendar   5   = VAR   BaseCalendar  =      CALENDAR   (   DATE   (   2016 ,   1 ,   1   ) ,   DATE   (   2018 ,   12 ,   31   )   ) RETURN      GENERATE   (          BaseCalendar ,          VAR   BaseDate  =   [Date]          VAR   YearDate  =   YEAR   (   BaseDate  )          VAR   MonthNumber  =   MONTH   (   BaseDate  )          VAR   MonthName  =   FORMAT   (   BaseDate ,   "mmmm"   ) ...