TGTGInsighttelegram intelligenceLIVE / telegram public index
← Data Analytics
Data Analytics avatar

TGINSIGHT POST

Post #1994

@sqlspecialist

Data Analytics

Views4,160Post view count
PostedJul 2307/23/2025, 02:04 PM
Post content

Post content

Data Analyst Interview QnA 1. Find avg of salaries department wise from table. Answer- SELECT department_id, AVG(salary) AS avg_salary FROM employees GROUP BY department_id; 2. What does Filter context in DAX mean? Answer - Filter context in DAX refers to the subset of data that is actively being used in the calculation of a measure or in the evaluation of an expression. This context is determined by filters on the dashboard items like slicers, visuals, and filters pane which restrict the data being processed. 3. Explain how to implement Row-Level Security (RLS) in Power BI. Answer - Row-Level Security (RLS) in Power BI can be implemented by: - Creating roles within the Power BI service. - Defining DAX expressions that specify the data each role can access. - Assigning users to these roles either in Power BI or dynamically through AD group membership. 4. Create a dictionary, add elements to it, modify an element, and then print the dictionary in alphabetical order of keys. Answer - d = {'apple': 2, 'banana': 5} d['orange'] = 3 # Add element d['apple'] = 4 # Modify element sorted_d = dict(sorted(d.items())) # Sort dictionary print(sorted_d) 5. Find and print duplicate values in a list of assorted numbers, along with the number of times each value is repeated. Answer - from collections import Counter numbers = [1, 2, 2, 3, 4, 5, 1, 6, 7, 3, 8, 1] count = Counter(numbers) duplicates = {k: v for k, v in count.items() if v > 1} print(duplicates)