Forum Discussion

lavankumar1989a's avatar
2 years ago
Solved

Need help on DAX calculation

Hi Experts,   Looking for your support on creating a calcuated column to show the products information by apply sertain filters through dax. When it comes to my requirment, i have a table like bel...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi lavankumar1989a, thank you for your additional inforamtion!
    Please check the udpdated answer:

    UnSoldCount = 
    VAR SelectedStartDate = MIN('DateTable'[Date])
    VAR SelectedEndDate = MAX('DateTable'[Date])
    VAR AdjustedEndDate = EOMONTH(SelectedEndDate, -1)
    RETURN
    CALCULATE(
       COUNTROWS('Table'),
       FILTER(
           'Table',
           'Table'[Date] >= SelectedStartDate &&
           'Table'[Date] <= AdjustedEndDate &&
           'Table'[Status] = "unsold"
       ))
    
    UnSoldProduct = 
    VAR SelectedStartDate = MIN('DateTable'[Date])
    VAR SelectedEndDate = MAX('DateTable'[Date])
    VAR AdjustedEndDate = EOMONTH(SelectedEndDate, -1)
    RETURN
    CONCATENATEX(
        FILTER(
            'Table',
            'Table'[Date] >= SelectedStartDate &&
            'Table'[Date] <= AdjustedEndDate &&
            'Table'[Status] = "unsold"
        ),
        'Table'[Product],
        ", "
    )

    Result for your reference:

    Best regards,

    Joyce

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.