Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
Below is the data and have expected output as well. I am trying to write DAX expression to get the
Total Trainer Duration , | Trainer Name, | No of Student |
but couldn't success. any help would be much appreciated.
Data | |||||
ID | username | Category | Duration | ||
101 | John | Trainer | 60 | ||
101 | Tom | Student | 20 | ||
101 | Chris | Student | 30 | ||
101 | Wilson | Student | 40 | ||
Expected Output | |||||
ID | username | Category | Total Trainer Duration | Trainer Name | No of Student |
101 | John | Trainer | 60 | John | 3 |
101 | Tom | Student | 60 | John | 3 |
101 | Chris | Student | 60 | John | 3 |
101 | Wilson | Student | 60 | John | 3 |
Solved! Go to Solution.
pls try this
Measure = CALCULATE( sum('Table'[Duration]),FILTER(all('Table'),'Table'[Category]="Trainer"))
Measure 2 = maxx(FILTER(all('Table'),'Table'[Category]="Trainer"),'Table'[username])
Measure 3 = CALCULATE( COUNTROWS('Table'),FILTER(all('Table'),'Table'[Category]="Student"))
Proud to be a Super User!
pls try this
Measure = CALCULATE( sum('Table'[Duration]),FILTER(all('Table'),'Table'[Category]="Trainer"))
Measure 2 = maxx(FILTER(all('Table'),'Table'[Category]="Trainer"),'Table'[username])
Measure 3 = CALCULATE( COUNTROWS('Table'),FILTER(all('Table'),'Table'[Category]="Student"))
Proud to be a Super User!
Is this data in a query in Power BI Desktop already? If so, you do not need a DAX expression, you can just select the fields you want in a table visual.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
94 | |
82 | |
66 | |
58 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |