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,
I wanted to create a column (used for further calculations) where I sum the hours of all rows that are part of the same [code_name] that contains a determinated string ("work")
I used:
Col = SUMx(FILTER('table','table'[code_reason]="work"&& 'table'[code_name]=EARLIER('table'[code_name])),'table'[hours])
It show the right results, the problem is that I have a time slicer but even if you filter the dates the value of this column dont change.
Looking for an answer I saw that I should use a measure for this, but copy pasting the formula doesnt work.
Also using a matrix visualization with rows: code_name, column: code_reason, values: hours already show the correct values
My data are in this format:
code_name | name | code_reason | date | hours | COLUMN I WANT TO CREATE |
prod | john | work | 01/01/2021 | 8 | 32 |
prod | john | illness | 01/01/2021 | 0 | 32 |
prod | john | worked | 01/01/2021 | 8 | 32 |
prod | john | work | 02/01/2021 | 8 | 32 |
prod | john | illness | 02/01/2021 | 3 | 32 |
prod | john | worked | 02/01/2021 | 5 | 16 |
tech | willy | work | 01/01/2021 | 8 | 16 |
tech | willy | illness | 01/01/2021 | 8 | 16 |
tech | willy | worked | 01/01/2021 | 0 | 16 |
tech | willy | work | 02/01/2021 | 8 | 16 |
tech | willy | illness | 02/01/2021 | 0 | 16 |
tech | willy | worked | 02/01/2021 | 8 | 16 |
prod | dan | work | 01/01/2021 | 8 | 32 |
prod | dan | illness | 01/01/2021 | 0 | 32 |
prod | dan | worked | 01/01/2021 | 8 | 32 |
prod | dan | work | 02/01/2021 | 8 | 32 |
prod | dan | illness | 02/01/2021 | 3 | 32 |
prod | dan | worked | 02/01/2021 | 5 | 32 |
Solved! Go to Solution.
@tWdex , Column will not take slicer filter. Try measure like
SUMx(FILTER(allselected('table'),'table'[code_reason]="work"&& 'table'[code_name]=max('table'[code_name])),'table'[hours])
or
SUMx(FILTER(allselected('table'),'table'[code_reason]="work"&& 'table'[code_name]=max('table'[code_name]) && 'table'[Date] in allselected('Table'[Date])),'table'[hours])
Use this measure, Its working for me.
and for date create seperate date table using calendar function and relate both the tables.
this should work
Use this measure, Its working for me.
and for date create seperate date table using calendar function and relate both the tables.
this should work
@tWdex , Column will not take slicer filter. Try measure like
SUMx(FILTER(allselected('table'),'table'[code_reason]="work"&& 'table'[code_name]=max('table'[code_name])),'table'[hours])
or
SUMx(FILTER(allselected('table'),'table'[code_reason]="work"&& 'table'[code_name]=max('table'[code_name]) && 'table'[Date] in allselected('Table'[Date])),'table'[hours])
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 | |
81 | |
66 | |
58 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |