Forum Discussion

mith_tina's avatar
mith_tina
Frequent Visitor
4 years ago
Solved

How to change my datesbetween function dynamically?

i write my code like below. I connect with my date table but when i use date table i am getting total value. It is not filtering the value. so i use dates between function and use the table's date co...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi mith_tina ,

    Please have a try.

    Create columns first.

    Year_column=Year(Candiadte[Added Date])
    Month_column=Month(Candiadte[Added Date])

    Then create a measure.

    Current_month_Candidate =
    IF (
        MAX ( EMT[MG] ) = "TC",
        (
            CALCULATE (
                COUNT ( Candidate[JReq] ),
                FILTER (
                    ALL ( Candiadte ),
                    Candidate[JobLevel]
                        IN { "B", "C", "D" }
                            && Candiadte[month_column] = SELECTEDVALUE ( Candiadte[month_column] )
                            && Candiadte[Year_column] = SELECTEDVALUE ( Candiadte[Year_column] )
                )
            )
        )
    )
    

     

    If I have misunderstood your meaning, please provide your pbix file without privacy information and your desired output with more details.

     

    Best Regards

    Community Support Team _ Polly

     

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