Posts

Showing posts with the label CROSSJOIN

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] , ...

Using OR conditions between slicers in DAX

  https://www.youtube.com/watch?v=l5JX3G5Ntzk https://www.sqlbi.com/articles/using-or-conditions-between-slicers-in-dax/ Set-Based Solution: Create table to be used as a filter in CALCULATE: UNION Crossjoin the selections in the Product[Brand] slicer with any Customer[Occupation] Crossjoin the selections in the Customer[Occupation] slicer with any Product[Brand] OR   # 1   := CALCULATE   (      [Units] ,      UNION   (          CROSSJOIN   (   VALUES   (   'Product'[Brand]   ) ,   ALL   (   Customer[Occupation]   )   ) ,          CROSSJOIN   (   ALL   (   'Product'[Brand]   ) ,   VALUES   (   Customer[Occupation]   )   )      ) )