Forum Discussion

Joshi_AB7071's avatar
Joshi_AB7071
Regular Visitor
3 years ago
Solved

DAX flag for Last Completed Quarter

Hello DAX guru's   I'm trying to create a filter in the DimDate table , which would put the flag as True when the data is in last completed Quarter. In my dashboard Fiscal Year starts from Octobe...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Joshi_AB7071 ,

    I created a sample file(see the attachment) base on your provided sample data, please check that is what you want. You can create two calculated columns as below to get it:

    Fiscal Year Quarter = 
    'Table'[FY]
        & IF (
            'Table'[Month] IN { "Oct", "Nov", "Dec" },
            "Q1",
            IF (
                'Table'[Month] IN { "Jan", "Feb", "Mar" },
                "Q2",
                IF ( 'Table'[Month] IN { "Apr", "May", "Jun" }, "Q3", "Q4" )
            )
        )
    Flag = 
    VAR _count =
        CALCULATE (
            COUNT ( 'Table'[Fiscal Year Quarter] ),
            FILTER (
                'Table',
                'Table'[Fiscal Year Quarter] = EARLIER ( 'Table'[Fiscal Year Quarter] )
                    && 'Table'[Amount] > 0
            )
        )
    RETURN
        IF ( _count = 3, "True", "False" )

    Best Regards