Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Dynamic calculate based on the parameter value provided by user

Hello, Need some help with 2 issue ..    1- I am trying to generate a buffer flag where the "EndignonHand" (EOH) is greater then 0 for the dates < today + # of weeks (provided by the user)..  So ...
  • v-yueyunzh-msft's avatar
    v-yueyunzh-msft
    3 years ago

    Hi , Anonymous 

    Thanks for your quick response!I download your pbix file and i can open it successfully!

    For your two needs , here are the steps you can refer to :
    (1)We can just modify your [IsInBuffer-check] measure like this:

    IsInBuffer-check = if(min(SummarizedTable[EndingOnHand])<=0 && min(SummarizedTable[Weekdate])<= [Today+Weeknum], "N","Y")
    

    Then we can get this:

    (2)For your second need , we can click "New Table" and enter this:

    Table 3 = ADDCOLUMNS( ADDCOLUMNS (
        SUMMARIZE (
            RawDataTable,RawDataTable[Filekey],RawDataTable[Item],RawDataTable[Itemkey],RawDataTable[location],RawDataTable[Productname],RawDataTable[Source]
        ),
        "Weekdate",  var _t =  CALCULATETABLE('RawDataTable')  var _t2 = FILTER(_t,[EndingOnHand]<=0)   return IF(MINX(_t2,[Weekdate])=BLANK() , MINX(_t,[Weekdate]) ,MINX(_t2,[Weekdate]))
        
    ), "EndingOnHand",var _date= [Weekdate] var _t = FILTER( CALCULATETABLE('RawDataTable'),[Weekdate]=_date) return minx(_t,[EndingOnHand])  )

     

    Then we can get the result table like this:

     

    Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

     

    Best Regards,

    Aniya Zhang

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