Forum Discussion

jschembre's avatar
jschembre
Regular Visitor
4 years ago
Solved

Predictive analysis using survey results

I am working with a survey in which each respondent answers multiple times on multiple days.  I'm not sure if my problem would be better solved using a different data model or if it's measures.   I...
  • MFelix's avatar
    4 years ago

    Hi jschembre ,

     

    Create two disconnected tables with the days and the colors then add the following measure:

     

    Preidction =
    VAR selectedLines =
        FILTER (
            GROUPBY ( ALLSELECTED ( 'Table' ), 'Table'[color], 'Table'[Name], 'Table'[day] ),
            'Table'[day] = SELECTEDVALUE ( 'Weekday'[WeekDay] )
                && 'Table'[color] = SELECTEDVALUE ( 'Color Slicer'[Color] )
        )
    VAR Selectpersons =
        SELECTCOLUMNS ( selectedLines, "Persons", 'Table'[Name] )
    RETURN
        COUNTROWS ( FILTER ( 'Table', 'Table'[Name] IN Selectpersons ) )

     

    Result below and in attach PBIX file.