Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi ,
I have a matrix that looks like below :
employee | 8/31/2020 | 9/1/2020 | 9/2/2020 | 9/3/2020 | 9/4/2020 |
John | Open | Open | Open | Abc Solutions | Open |
Beth | Open | Open | Omega technologies
| Open | Open |
Mary | Open | Open | Open | Open | Horizon solutions |
I have a scheduledhours column measure that contains hours for every employee on a certain date.
I want to sum all the scheduled hours for a date and show it below like this in a matrix:
employee | 8/31/2020 | 9/1/2020 | 9/2/2020 | 9/3/2020 | 9/4/2020 |
John | Open | Open | Open | Abc Solutions | Open |
Beth | Open | Open | Omega technologies
| Open | Open |
Mary | Open | Open | Open | Open | Horizon solutions |
|
|
|
|
|
|
|
|
|
|
|
|
Total hours | Sum(scheduledhours) | Sum(scheduledhours | Sum(scheduledhours | Sum(scheduledhours | Sum(scheduledhours |
How can I do this ? Any suggestions are appreciated.
Solved! Go to Solution.
Hi @Anonymous
Build a table like yours to have a test.
I use Hasonevalue function like lbendlin replied and if function to build a measure
Measure:
Measure =
IF (
HASONEVALUE ( 'Table'[Employee] ),
MAX ( 'Table'[Status] ),
SUMX (
FILTER ( 'Table', 'Table'[Date] = MAX ( 'Table'[Date] ) ),
'Table'[Scheduledhour]
)
)
Result:
You can download the pbix file from this link: matrix total row based on sum of rows of a different column
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous , I do not see any scheduled hour here. Is the first table is matrix visual or your raw data. If it is raw data you need unpivot.
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
@amitchandakthe first table is a matrix visual. I want to add a row at the end to show total sum of hours for every date column. I have a column called "ScheduledHours" added in the table but it is not added to the matrix visual.
Hi @Anonymous
Build a table like yours to have a test.
I use Hasonevalue function like lbendlin replied and if function to build a measure
Measure:
Measure =
IF (
HASONEVALUE ( 'Table'[Employee] ),
MAX ( 'Table'[Status] ),
SUMX (
FILTER ( 'Table', 'Table'[Date] = MAX ( 'Table'[Date] ) ),
'Table'[Scheduledhour]
)
)
Result:
You can download the pbix file from this link: matrix total row based on sum of rows of a different column
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous
Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file from your Onedrive for Business.
Best Regards,
Rico Zhou
In your measure use
HASONEVALUE(table[Employee])
to distinguish between the individual appointments and the column totals.
User | Count |
---|---|
124 | |
108 | |
99 | |
62 | |
62 |
User | Count |
---|---|
137 | |
115 | |
102 | |
71 | |
61 |