Forum Discussion
problem with Dax measure
ania_roh Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
Yes, Mahesh0016, thank you.
I created powerbi sample but I don´t find a way to attach it here.
The table would be like that : (localizacion_destino, localización_destino_original, value)
| 1111 | 1111 | 1 |
| 2343 | 1111 | 2 |
| 2345 | 2345 | 3 |
| 7642 | 3456 | 4 |
| 3456 | 3456 | 5 |
| 1111 | 2343 | 6 |
| 2343 | 1111 | 7 |
| 7642 | 7642 | 8 |
| 1111 | 2345 | 9 |
| 7642 | 4582 | 10 |
The measure X would be like that:
The visualization is like that:
Now I need calculate Y (the next column in the visualization) and I don´t know how.
For this example, for ID_destino = 1111, Y should give 15:
Thank you a lot
- Mahesh00163 years ago
Super User
Y =SUMX (FILTER (localizationTable,localizationTable[localizacion_destino] = 1111&& localizationTable[localización_destino_original] = 1111),localizationTable[value])****************************************************************************************
_Y =SUMX (FILTER (localizationTable,localizationTable[localizacion_destino] = 1111),localizationTable[value])ania_roh If this post helps, please consider accept as solution to help other members find it more quickly and Appreciate your Kudos.
- ania_roh3 years ago
Helper III
Yes Mahesh0016 but I want to have it for all rows of that visualizations.
Not only for 1111 (I put it to give an example).
- FreemanZ3 years ago
Super User
hi ania_roh
Not sure if i fully get your, try to write the measure like this:
Y = VAR _dest = MAX(TableName[DestOrig]) RETURN SUMX( FILTER( ALL(TableName), TableName[Dest] = _dest &&TableName[DestOrig] <> _dest ), TableName[Value] )i tried and it worked like this: