Forum Discussion
Need Help - DAX Code
- 1 year ago
This is very simple but in your original data it was not like this, here is the table you showed
Anyway I adjusted the data and now I have the following
and now I have what you want without any hardwiring:
Test =VAR Ticket = Tabella[Ticket No]RETURNSUMX ( FILTER ( Tabella, Tabella[Parent Ticket] = Ticket ), Tabella[Total Hrs] )The above is a columnIf you want a measure, let me knowIf this helped, please consider giving kudos and mark as a solution
me in replies or I'll lose your threadWant to check your DAX skills? Answer my biweekly DAX challenges on the kubisco Linkedin page
Consider voting this Power BI idea
Francesco Bergamaschi
MBA, M.Eng, M.Econ, Professor of BI
| Ticket No | Summary | Parent Ticket | Total Hrs | ||
| 1049039 | Data Conversion | 678.5 | |||
| 1323146 | Table Conversion | 10493039 | 346 | ||
| 1456862 | Table Conversion_1 | 10493039 | 240 | ||
| 1140978 | Hourly Conversion | 186.5 | |||
| I need result like this | |||||
| Ticket No | Summary | Parent Ticket | Total Hrs | Relevant hrs | Total Hrs |
| 1049039 | Data Conversion | 678.5 | 586 | 1264.5 | |
| 1323146 | Table Conversion | 10493039 | 346 | ||
| 1456862 | Table Conversion_1 | 10493039 | 240 | ||
| 1140978 | Hourly Conversion | 186.5 |
many different parent ticket is not possible, one parent ticket only for one ticket
- FBergamaschi1 year agoSuper User
calculated column code
Colonna =IF ( ISBLANK( Tabella[Parent Ticket] ) && Tabella[Summary ] <> "Hourly Conversion", SUMX ( FILTER ( Tabella, NOT ISBLANK( Tabella[Parent Ticket] ) ), Tabella[Total Hrs] ) )If this helped, please consider giving kudos and mark as a solution
me in replies or I'll lose your threadWant to check your DAX skills? Answer my biweekly DAX challenges on the kubisco Linkedin page
Consider voting this Power BI idea
Francesco Bergamaschi
MBA, M.Eng, M.Econ, Professor of BI
- itsranga1 year agoHelper IColonna =IF ( ISBLANK( Tabella[Parent Ticket] ) && Tabella[Summary ] <> "Hourly Conversion", SUMX ( FILTER ( Tabella, NOT ISBLANK( Tabella[Parent Ticket] ) ), Tabella[Total Hrs] ) )
This IF condition is hardcoded for 'Hourly conversion'. I tried to avoid this code and used a DAX expression instead, but it caused a circular dependency error. Please correct the error- FBergamaschi1 year agoSuper User
That was the only way to avoid getting the 586 total also in the last row which also has blank Parent Ticket
I do not find your code, though, where is it? In your message I only see my code