Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
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.
@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.
User | Count |
---|---|
82 | |
81 | |
52 | |
39 | |
35 |
User | Count |
---|---|
95 | |
79 | |
52 | |
49 | |
47 |