Forum Discussion

kauschan65's avatar
kauschan65
Frequent Visitor
7 years ago

Dynamically update column based on date slicer on PowerBi

I am new to PowerBi and have questions regarding dynamic filtering based on datetime slicer . Say I have the following table:

enter image description here

Based on the date range(TableDateTime) I select from the slicer in powerbi i want to do the following :

If ApprovalInNumber. > 0 && if TimesApproved > 1 Get all the columns with Max(Rev) for this Id where Approvals/Rejects = Approve.

If ApprovalInNumber. < 1 Get all the columns with Max(Rev) for this Id where Approval/Rejects = Reject .

I would want to do this for all duplicate Id's . How can i achieve this dynamically based on the date range slicer . Any help is much appreciated

3 Replies

  • v-danhe-msft's avatar
    v-danhe-msft
    Microsoft Employee

    Hi kauschan65 ,

    I could not understand the "achieve this dynamically based on the date range slicer"?

    It seemed that your if statements related no data with your date range? And could you mean if 

    ApprovalInNumber. > 0 && if TimesApproved > 1 

    The desired result for id 127 where [REvNO]=2,3,4 should all be to 7(Max REv)?

     

    Regards,

    Daniel He

    • kauschan65's avatar
      kauschan65
      Frequent Visitor

      v-danhe-msft: Appreciate the response. 

       

      Taking the example of your case :

       

      say my datetime slicer is from : 3/8 to 3/20

       

      and ApprovalNumber > 0 && TimesApproved > 1 the desired result would be the Max Rev = 4 .  

       

      But in case lets take the date range : 3/15 to 3/20 

       

      where you dont have any instance of (ApprovalNumber > 0 && TimesApproved > 1) the desired result would be Max Rev = 7 

      • v-danhe-msft's avatar
        v-danhe-msft
        Microsoft Employee

        Hi kauschan65 ,

        If let take the date range : 3/15 to 3/20, there is no  row in ApprovalNumber > 0, I could not understand your condition: ApprovalNumber > 0 && TimesApproved > 1

        If there is no data in ApprovalNumber > 0, why the desired result should be 7?

         

        Regards,

        Daniel He