Forum Discussion

B_Rax's avatar
B_Rax
Helper I
1 year ago
Solved

How to Maintain Submission Window Context

I'm currently attempting to create a dax measure that seems simple, but is giving me a lot of trouble. I have a table populated with document submission dates. I want to have a table visual with a Da...
  • B_Rax's avatar
    B_Rax
    1 year ago

    I added a blank check field using this DAX:

    Blank Check = 
         DISTINCTCOUNT('Submitted Documents'[Form ID]) & 
         IF(
              ISBLANK(SELECTEDVALUE('Submitted Documents'[Date Submitted])), 
              "No Submission", 
              " Submitted"
         )

    The color formatting DAX is now:

    Submission Window = 
    VAR inWindow = 
        IF(
            SELECTEDVALUE('Calendar'[Weekday Num]) >= 1 && 
            SELECTEDVALUE('Calendar'[Weekday Num] ) <= 3, 
            TRUE(), 
            FALSE()
        )
    VAR color = 
        SWITCH (
            TRUE(),
            inWindow, "Green",
            "Red"
        )
    
    RETURN
        color

    This leads to this result with some aggregation on Submitter:

    It's starting to look much closer to what I'm trying to achieve. However, if I change "No Submission" to Blank(), which looks much nicer, the color drops again. To fix that I used "" instead of Blank(). I'll try to go with this compromise for now, but I'd love to hear if you or anyone else knows why my conditional formatting disappears when values on the many side of the relationship are included but are all blank:

     

    Thank you!