Forum Discussion

JemmaD's avatar
JemmaD
Icon for Helper V rankHelper V
3 years ago
Solved

Create measure which shows total AND a category

Hi there,   I have a table of data showing clients, and total number of meetings with those clients each day.  My report consumer wants to see if the meetings on that day were virtual or face to f...
  • mh2587's avatar
    3 years ago
    Meeting Summary = 
    VAR VirtualCount = CALCULATE(
        COUNTROWS(YourTable),
        FILTER(YourTable, [Meeting Type] = "Virtual")
    )
    
    VAR FaceToFaceCount = CALCULATE(
        COUNTROWS(YourTable),
        FILTER(YourTable, [Meeting Type] = "Face to Face")
    )
    
    RETURN
    IF(
        VirtualCount > 0 && FaceToFaceCount > 0,
        VirtualCount & " virtual " & FaceToFaceCount & " face to face",
        IF(
            VirtualCount > 0,
            VirtualCount & " virtual",
            IF(
                FaceToFaceCount > 0,
                FaceToFaceCount & " face to face",
                BLANK()
            )
        )
    )