Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

First Date where the % is less than 90

Hi, I have below report, I want to show the first date where the % is less than 90% per State per RC.     Can anyone help?    
  • Jihwan_Kim's avatar
    4 years ago

    Hi,

    Please check the below picture and the attached pbix file.

     

     

    First date less than 90% =
    VAR newtable =
        ADDCOLUMNS (
            SUMMARIZE ( Data, Data[State], Data[RC], Data[Date] ),
            "@ratio", CALCULATE ( DIVIDE ( SUM ( Data[Count] ), SUM ( Data[Slots] ) ) )
        )
    VAR filtertable =
        FILTER ( newtable, [@ratio] < 0.9 )
    RETURN
        IF ( HASONEVALUE ( Data[State] ), MINX ( filtertable, Data[Date] ) )
    
  • Anonymous's avatar
    Anonymous
    4 years ago

    This is my DAX:

    First date less than 90% =
    VAR newtable =
    ADDCOLUMNS (
    SUMMARIZE ( Count, Location[State], Location[RC], Data[Date] ),
    "@ratio", CALCULATE ( DIVIDE ( SUM ( Count[Count] ), SUM ( Slots[Slots] ) ) )
    )
    VAR filtertable =
    FILTER ( newtable, [@ratio] < 0.9 )
    RETURN
    IF ( HASONEVALUE ( Location[State] ), MINX ( filtertable, Data[Date] ) )

     

    and I get below, it correctly filter <90, but not the min date per RC: