Forum Discussion

majidht's avatar
majidht
Frequent Visitor
9 years ago
Solved

Slicer - Date and Time

Hello, I've created a cube using visual studio and I am trying to get reports with Power BI. I need to have specific times frames for my report. The only options I saw on Power BI are slicers. Do yo...
  • v-huizhn-msft's avatar
    v-huizhn-msft
    9 years ago

    Hi majidht,

    I can reproduce your scenario, I get date from SSAS with inport mode as follows.



    First, I can change the Text to Date type using the Formatting feature, please see the following screenshot.



    Second, If you can not change the data type directly, you can split the date column to year, month, day column in Power Query Editor. Please select Split Column under on Query Editor Home, click appropriate delimiter.



    When you get year, mon, day. If Month column is January format, you can use the following formula to change it to number.

    SWITCH([Month],  "January", 1,"February", 2,  "March",3,  "April",4
                   , "May", 5,"June", 6, "July",  7, "August",8
                   , "September",9, "October",  10,  "November",11, "December" 12
                   , 0 ) 


    Then you can use DATE function to create calculated column to get Date column.

    Date=DATE([Year],[Month],[day])


    Finally, you can create a slicer as Tulio_DL posted. In addition, there is a similar thread you can reference to.

    Best Regards,
    Angelia