Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Access variable within IF statement from a non summarized field

The logic of the query is as follow: SummaHours = CALCULATETABLE( SUMMARIZE( 'RESBOOK (2)', 'RESBOOK (2)'[Name], "3M", SUM('RESBOOK (2)'[3M]), "3MH", IF('RESBOO...
  • rubayatyasmin's avatar
    rubayatyasmin
    3 years ago

    Good catch. MAX is used here to make sure we always have a single value to use in our IF statement, even when our context might have multiple rows. We can use lookup value. see if this helps.

     

    "3MH", IF(LOOKUPVALUE('RESBOOK (2)'[Priority],'RESBOOK (2)'[Name],'RESBOOK (2)'[Name]) IN {"Audit", "Reporting"}, CALCULATE(COUNTROWS(Calndar), DATESBETWEEN(Calndar[Dates ],TODAY(),edate(TODAY(),3)), Calndar[WD] == "True")*5.6, CALCULATE(COUNTROWS(Calndar), DATESBETWEEN(Calndar[Dates ],TODAY(),edate(TODAY(),3)), Calndar[WD] == "True")*7),

     

     

    if my assistance helps you in any way, hit 👍