Forum Discussion

JFGrenier's avatar
JFGrenier
Frequent Visitor
6 years ago

DAX Query using CROSSFILTER

Hi!
I'm familiar with SQL but a DAX newbie!
Using DAX Studio from Excel / Power Pivot.
Part of my Data Model looks like this:

 

 

 

 

 

 

 

 

 

 

 

 

This sample query is functionnal and group some fields on table 1 with criteria on table 1 and 2 , and SUM the value

EVALUATE (
    SUMMARIZE ( 
	FILTER (Req_PaysM, [Annee] IN {2019,2020} && [Ech] = 1 && RELATED ( Part_Commercial[NoPays] ) = 9),
        [Annee],
        Mois[NomMois],
        "NomPays", FORMAT ( "Monde (tous les produits)", "@" ),
        "Echange", FORMAT ( "Importations", "@" ),
        "Valeur", SUM ( Req_PaysM[Valeur] )
    )
)

Now I wanna build a query that would somewhat do the same thing except that a criteria must be set in table 3
[NoRegroupement]=1 and group by [NomRegrp] also in table 3.

 

I read that I can use CROSSFILTER or USERELATIONSHIP to achive what I need but those function can only be used with the CALCULATE function.

 

So I'm having difficulties figuring out the correct syntax for grouping some fields from table 1 and 3 with criteria on table 1 and 3, and summing the value.

 

Any help and comments would be greatly appreciated.
Thank's
JF.

5 Replies