Forum Discussion

andfx's avatar
andfx
Frequent Visitor
7 years ago
Solved

Help using matrix

Hi guys,   I have those databases for example:   categories.csv id;name;category 1;fiat;ford 2;onix;gm 3;etios;toyota 4;macan;porsche 5;enzo;ferrari history.csv date;value;id 17/01/2019;1100;1...
  • MFelix's avatar
    MFelix
    7 years ago

    Hi andfx,

     

    You need to have a 1 to Many relationship wiht a single cross filter direction, then add the following measure to your data:

     

    Predict/history =
    SWITCH (
        TRUE ();
        SUM ( History[value] ) <> 0; SUM ( History[value] );
        SUM ( Predict1[value] ) <> 0; SUM ( Predict1[value] );
        SUM ( Predict2[value] ) <> 0; SUM ( Predict2[value] );
        BLANK ()
    )

    Be aware that this formula is assuming that predit 1 and predict 2 includes diferrente dates and they are also not on the history table.

     

    Result is below and attached PBIX file.

     

     

    Regards,

    MFelix