Calculated Measures Help

Hi, I’ve been trying to add calculated field to determine Resource Type based on following criteria: ifelse({Level}=‘6’ AND CountDirects >=‘5’,‘Manager’,‘Individual’). However, the approach I’ve currently taken adds CountDirects as countover ({Employee},[{Supervisor}],PRE_AGG) - i.e. it will show supervisor count of directs and not the employee count of directs.
As a result, Manager is applied to employee lines where supervisor has >=5 directs.
Question: how can I change the CountDirects measure to calculate # of times an Employee is included in Supervisor column? Simply swapping the columns in the formula results with 1 for each line…

image

Hi, @Marianne_Parsik

Wanted to let you know that we have this live Q&A today at 12 PM PDT. Feel free to join if you have any interest in talking through this or any other question real-time with one of our Solution Architects today. :slight_smile:

cc: @Asem

Hi @Marianne_Parsik

Got a solution for you. Below please find final results, dataset updates and formulas required.

Final Result
image

Dataset
Added and joined the same table a second time. Please note join type and columns joined on.

  • You can probably clean up the columns
    ** This will change structure abit of your data yet will allow to compute what you need. Just needs to be accounted for with other calculations.

Formulas

image

Please let me know if this does the trick.

thanks!
Ramon Lopez

1 Like

Thanks, Ramon!
Unfortunately, the dataset is locked to direct query and hence does not allow joins…

Hi @Marianne_Parsik

Direct Query Datasets DO allow joins. Is it locked maybe due to RLS?

As an author another option is to create a child dataset, and in that one create the join above to get the analysis you looking for.

Will that work?
thanks!
Ramon Lopez

1 Like

Hi @Marianne_Parsik

Did @Ramon_Lopez answer your question? If so, please help the community out by marking this answer as “Solution!”

Thank you!

Correct, it has row level security.
Can you please elaborate on “child dataset” topic? I currently have duplicated the dataset and added relevant filters, but it doesn’t remove the RLS. Is there another way to convert this into a dataset I can join?