Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Need help with power bi

 

# of Projects in Progress =
CALCULATE (
    COUNTROWS ( DataDump1 ),
    FILTER ( DataDump1, DataDump1[Vendor] = EARLIER ( DataDump1[Vendor] ) ),
    FILTER (
        DataDump1,
        DataDump1[Subject Matter] = EARLIER ( DataDump1[Subject Matter] )
    ),
    AND (
        FILTER ( DataDump1, DataDump1[Sent To Accounting Date].[Date] = BLANK () ),
        FILTER ( DataDump1, DataDump1[POWord Count] > 0 )
    )
)

 

Here is my Dax syntax. When I use this syntax it will filter and count the rows I am looking for, however, it leaves off the last filter FILTER(DataDump1,DataDump1[POWord Count] > 0)

 

Can someone please help me correct this so my syntax will filter the columns and filter if the date field is empty and word count is greater than 0? Thank you!

  • Hi Anonymous

     

    You may try below DAX:

    Column  =
    IF (
        DataDump1[POWord Count] > 0
            && DataDump1[Sent To Accounting Date].[Date] <> BLANK (),
        COUNTROWS (
            FILTER (
                DataDump1,
                DataDump1[Vendor] = EARLIER ( DataDump1[Vendor] )
                    && DataDump1[Subject Matter] = EARLIER ( DataDump1[Subject Matter] )
            )
        )
    )

    Regards,

    Cherie

3 Replies

  • ChrisMendoza's avatar
    ChrisMendoza
    Icon for Resident Rockstar rankResident Rockstar

    Anonymous,

     

    Not an answer for your issue but, rather a suggestion to help get your solution answered sooner rather than later:

     

    Use the Insert Code feature for your post and format your code block so it can be more easily read like:

     

    # of Projects in Progress =
    CALCULATE (
        COUNTROWS ( DataDump1 ),
        FILTER ( DataDump1, DataDump1[Vendor] = EARLIER ( DataDump1[Vendor] ) ),
        FILTER (
            DataDump1,
            DataDump1[Subject Matter] = EARLIER ( DataDump1[Subject Matter] )
        ),
        AND (
            FILTER ( DataDump1, DataDump1[Sent To Accounting Date].[Date] = BLANK () ),
            FILTER ( DataDump1, DataDump1[POWord Count] > 0 )
        )
    )

    I use http://www.daxformatter.com/ for formatting.

  • v-cherch-msft's avatar
    v-cherch-msft
    Icon for Microsoft Employee rankMicrosoft Employee

    Hi Anonymous

     

    You may try below DAX:

    Column  =
    IF (
        DataDump1[POWord Count] > 0
            && DataDump1[Sent To Accounting Date].[Date] <> BLANK (),
        COUNTROWS (
            FILTER (
                DataDump1,
                DataDump1[Vendor] = EARLIER ( DataDump1[Vendor] )
                    && DataDump1[Subject Matter] = EARLIER ( DataDump1[Subject Matter] )
            )
        )
    )

    Regards,

    Cherie