Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Affect value based on date range

Hi, I am quite new to PowerBI, and I want to do something that I am able to do with Excel and Macros I have one table called SALES Order,Order_Date,Product,EAN,Categorie,Volume,Price   On the co...
  • v-yulgu-msft's avatar
    8 years ago

    Hi Anonymous,

     

    First cross join SALES table and CATEGORIE table.

    Table_1 =
    FILTER (
        CROSSJOIN (
            SELECTCOLUMNS ( SALES, "Order", SALES[Order], "Order_Date", SALES[Order_Date] ),
            CATEGORIE
        ),
        [Order_Date] >= [Start_Date]
            && [Order_Date] <= [End_Date]
    )
    

     

    Then, calculate the order number grouped on Suppliers and Category.

    Table_2 =
    SUMMARIZE (
        Table_1,
        Table_1[Supplier],
        Table_1[Categorie],
        "Count Order", COUNT ( Table_1[Order] )
    )

     

    Best regards,

    Yuliana Gu