Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowHi,
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.
@Anonymous
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!
@Anonymous
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.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
User | Count |
---|---|
92 | |
67 | |
66 | |
43 | |
40 |