Forum Discussion

Ttaylor9870's avatar
Ttaylor9870
Helper III
3 years ago
Solved

Assigning Values based on conditions

Hi All,

 

I am looking to reassign a value based on specific conditions, here is my table below...

 

NameAmountDelivery Day
A1Blank
A2Day 1
A1Day 1
A5Day 2
B4Day5
B5Blank
B12Day2
C7Day 3
C8Day 1
C17Day5

 

for example I would like the Delivery Day to be reassigned to be the Delivery Date that is over 50% of the total amount (solution can't be max) and here is what I would therefore expect to see...

 

NameAmountDelivery Date
A6Day 2
B15Day 2
C24Day 5

If this solution was a calculated column that would be great! 😊

 

Many Thanks in advance for your help!

 

Taylor

  • FreemanZ's avatar
    FreemanZ
    3 years ago

    hi Ttaylor9870 

    try to plot a table visual with Name column and two measures like:

    AmountSum = SUM(TableName[Amount])
    
    MaxDeliveryDate = 
    MINX(
        FILTER(
            TableName, 
            TableName[Amount]=MAX(TableName[Amount])
        ),
        TableName[Delivery Day]
    )

     

    it worked like:

  • Hi FreemanZ,

     

    How would this then look if you were to change it to No of rows opposed to Amount?

    NameAmountDelivery Day
    A1Blank
    A2Day 1
    A1Day 1
    A5Day 2
    B4Day5
    B5Blank
    B8Day 2
    B12Day2
    C7Day 3
    C8Day 1
    C17Day5
    C1Day 1

     

    CompanyAmountDelivery Day
    A9Day 1
    B29Day 2
    C33Day 1

8 Replies

    • Ttaylor9870's avatar
      Ttaylor9870
      Helper III

      Hi FreemanZ ,

       

      There was no calculated columns or measures to create the columns that's they way they naturally sit. 
      I'd like the amounts added up and then whatever Delivery day had more than 50% of the total then assign delivery date to that.