Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ShbWatson
Last active December 9, 2018 18:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ShbWatson/d1413adc6b1542fe1fcc07d29e289817 to your computer and use it in GitHub Desktop.
Save ShbWatson/d1413adc6b1542fe1fcc07d29e289817 to your computer and use it in GitHub Desktop.
Bad DAX query
/* Copyright (c) 2018 ABI Cube */
/* Shabnam Watson */
/*
Important:
Do not run this on a production server!
*/
--------------------
EVALUATE
ROW("CRAZY CROSS JOIN",
COUNTROWS(
SUMMARIZE( --Groups by columns: Remember Group BY is equivalant to Distinct
CROSSJOIN(
SELECTCOLUMNS('Garbage Carts',"Garbage Carts SRN",[Service Request Number]),
SELECTCOLUMNS('Graffiti',"Grafitti SRN",[Service Request Number]),
SELECTCOLUMNS('Pot holes',"Pot holes SRN",[Service Request Number]),
SELECTCOLUMNS('Rodent Baiting',"Rodent Baiting SRN",[Service Request Number]),
SELECTCOLUMNS('Street Lights',"Street Lights SRN",[Service Request Number])
)
,
[Garbage Carts SRN],
[Grafitti SRN],
[Pot holes SRN],
[Rodent Baiting SRN],
[Street Lights SRN]
)
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment