Forum Discussion

deboec's avatar
deboec
Helper I
4 years ago
Solved

DAX syntax for SQL query

Hi,   I have a SQL query for my database which I use for grouping entries in a survey table by specific departments. As a result I want a simple table that looks somewhat like my SQL query. SQL q...
  • Whitewater100's avatar
    4 years ago

    Hi:

    These answers depend on how your model is set up. I will paste a link to a file that shows the model set up and then thetwo measures for DISTINCTCOUNT. 

    I will link a file example for MAX Distinct Count. I have used my table names and you would substitute in your "Department" table name where I have Channel. and where I used Data[Order ID] that's where you put your table[column name] which I think is  mpqr.[MEDIC_UID] but I can't tell. I hope this helps. It looks a little overwhelming but is not too hard if you go step by step. You'll notice the first DISTINCTCOUNT measure is referenced in the final measure (solution measure), MAX DISTINCT COUNT.

    https://drive.google.com/file/d/10mpcXrtjdtE7BGiqhArgUafjTk7StYUQ/view?usp=sharing