it should beselect count(t1.yourcol) as X,t3.prod_desc,count(t2.yourcol) as Y from sales_order_line_dim t1inner joinsales_order_line_fct t2ont1.SALES_ORDER_LINE_KEY=t2.SALES_ORDER_LINE_KEYinner join prod_dim t3on t3.prod_key=t2.prod_keywhere SALES_ORDER_LINE_CANCELLED_FLG = 'N'andSALES_ORDER_LINE_FULFILLED_FLG = 'Y'andt1.ACTIVE_FLAG ='Y'andITM_TYPE_CODE in ('STANDARD', 'OPTION','INCLUDED')group by prod_descreplace yourcol with actual column whose count you want