Forum Discussion
Excel DAX query with bridge table using CROSSFILTER
- 6 years ago
JFGrenier Sure, that's the best decision, you may write a complex DAX that might break tomorrow if not written considering every possible detail, but a data model that's perfect would always give you the required soution with minimal DAX!
JFGrenier Try this: for countryname in case there are more than 1 value you can use CONCATENATEX ( CALCULATETABLE construct. The file is below my signature:
Table =
ADDCOLUMNS (
CALCULATETABLE ( SUMMARIZE ( Data, Data[Year] ), Data[Year] = 2019 ),
"Val",
CALCULATE (
[Total Value],
CROSSFILTER ( Data[IdCountry], Country[IdCountry], BOTH ),
CountryGroup[IdCountryGroup] = 1
),
"CountryName",
CALCULATE (
DISTINCT ( CountryGroup[CountryGroupName] ),
CROSSFILTER ( Data[IdCountry], Country[IdCountry], BOTH ),
CountryGroup[IdCountryGroup] = 1
)
)
Hello Antriksh,
I tried your latest DAX solution in my real 'Data model' (what I showed is a scale down and translated version).
Had to adapt it a bit for DAX studio in french and checked several times to match your code!
The filter on IdCountryGroup do not seem to have any effect... The country group name changes accordingly but the returned values are always the same. It's the sum of all values of the Data table for the filtered year. Guess I will have to change my data model.
Thank you for your time and knowledge!
- AntrikshSharma6 years ago
Community Champion
JFGrenier Sure, that's the best decision, you may write a complex DAX that might break tomorrow if not written considering every possible detail, but a data model that's perfect would always give you the required soution with minimal DAX!