Forum Discussion

P0W3RB1's avatar
P0W3RB1
Icon for Helper I rankHelper I
10 years ago
Solved

Dates - Last 4 weeks, Next 4 weeks

Dates !!!! :)

 

In Dynamics CRM its very easy to pull off a report of for example all Orders older than X week, or Orders due in Next X weeks. Seems odd that Power BI doesnt have this simple function, dont you think?

 

There is a Microsoft provided content pack for Dynamics CRM sales, a pre-built dashboard and set of reports. I notice they have done exactly what i need to do, see screenshot. I need to create one called "Last4Weeks" and also need the ability to select truor or false, just like Microsoft have done here. How have they done this???

 

 

 

  • You can edit it after this step manually, just add seciond condition in code

4 Replies

  • hohlick's avatar
    hohlick
    Icon for Continued Contributor rankContinued Contributor

    Hello P0W3RB1

    You can add custom column with UI in Query Editor:

    1. Select dates column
    2. In "Add column" tab in "Date" group select Age
    3. Select new column, in "Transformation" tab in "Duration" group select "Days"
    4. Add custom conditions column with condition like "if [AgeFromDate]<28 and [AgeFromDate]>0 then true else false", name it Last4Weeks
    5. Add custom conditions column with condition like "if [AgeFromDate]>-28 and [AgeFromDate]>0 then true else false", name it Next4Weeks
    6. You can finetune where to add todays orders
    • P0W3RB1's avatar
      P0W3RB1
      Icon for Helper I rankHelper I

      Hi hohlick at step 4 do you mean this condition box? if so i dont see an option for "And"

       

       

      • Add custom conditions column with condition like "if [AgeFromDate]<28 and [AgeFromDate]>0 then true else false", name it Last4Weeks

       

       

      • hohlick's avatar
        hohlick
        Icon for Continued Contributor rankContinued Contributor

        You can edit it after this step manually, just add seciond condition in code