Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Select a Specific Cell on a Table using Conditional Statement

Hello, in the [Count] column, I've wanted to return that value "60" on the [Latest] column that is unique and dependent on the [PO #] column. Its currently returning the value of the last cell in [Count] column which is "360" even though I've already used an IF statement that selects "Today" in [TODAY_SELECTOR ] column and "DAY" in [SHIFT SELECTOR] column.

So how do I get the value of 60 as it is the Latest Value in the "Today" and "Day Shift" of my data?
attached below is the image of my PowerBI.



Thank you!

  • Hi Anonymous ,

     

    Replace MAXX() with :

    CALCULATE(MAX('Table'[COUNT]),FILTER('Table','Table'[PO #]=EARLIER('Table'[PO #])&&'Table'[SHIFT SELECTOR]="DAY"&&'Table'[TODAY SELECTOR]="TODAY"))

     

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

2 Replies

  • HotChilli's avatar
    HotChilli
    Community Champion

    Add the TODAY_SELECTOR and SHIFT_SELECTOR to the FILTER.

    At the moment the FILTER creates a table of ALL the COUNT values for the  current PO# ( even though it only does that for the rows that meet the conditions in the IF statement)

  • V-lianl-msft's avatar
    V-lianl-msft
    Community Support

    Hi Anonymous ,

     

    Replace MAXX() with :

    CALCULATE(MAX('Table'[COUNT]),FILTER('Table','Table'[PO #]=EARLIER('Table'[PO #])&&'Table'[SHIFT SELECTOR]="DAY"&&'Table'[TODAY SELECTOR]="TODAY"))

     

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