Forum Discussion

DimaMD's avatar
DimaMD
Solution Sage
4 years ago
Solved

RFM segments

Hello community!   I've made RFM analysis in table. Score of RFM is calculated in real time with mesure.   I have another table with scores and names of segments. so every combined RFM score has ...
  • DimaMD's avatar
    DimaMD
    4 years ago

    HI, HotChilli 
    thanks for the tip, yesterday I managed to figure it out myself and write such a measure.
    I think someone will find this measure useful

     

    Segment RFM = 
    VAR _tab = 
    SELECTCOLUMNS(
        VALUES('Sales'[ID_USER]),
        "RFM_Seg",[RFM] )
    VAR _Seg =
    SELECTCOLUMNS(_tab,
        "#RFM_S",
        LOOKUPVALUE('Segment'[Segment],Segment[ID_RFM],[RFM_Seg]))
    return
    MAXX( _Seg,[#RFM_S])