Forum Discussion

DimaMD's avatar
DimaMD
Solution Sage
4 years ago
Solved

Create a table for today

Hello,
Is it possible to create a calculation table which will only show data for the current day
I have a general sales table and want to see a separate sales table for the current day.
This can be done in the DAX

thanks for the help

  • Hi, 

    According to your description, I can clearly understand your requirement, I think you can simply achieve your requirement by creating a calculated table like this:

    Data Today =
    
    FILTER('Table',[Date]=TODAY())

     

    And you can get what you want, like this:

     

    If you don’t want to create a table that is stored in the dataset and just want to make it displayed in the dashboard, you can apply the “Relative date” filter on your visual like this:

     

    For more info:

    https://docs.microsoft.com/en-us/power-bi/visuals/desktop-slicer-filter-date-range#create-the-relative-date-range-filter

     

    You can download my test pbix file below

    Thank you very much!

     

    Best Regards,

    Community Support Team _Robert Qin

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

4 Replies

  • v-robertq-msft's avatar
    v-robertq-msft
    Community Support

    Hi, 

    According to your description, I can clearly understand your requirement, I think you can simply achieve your requirement by creating a calculated table like this:

    Data Today =
    
    FILTER('Table',[Date]=TODAY())

     

    And you can get what you want, like this:

     

    If you don’t want to create a table that is stored in the dataset and just want to make it displayed in the dashboard, you can apply the “Relative date” filter on your visual like this:

     

    For more info:

    https://docs.microsoft.com/en-us/power-bi/visuals/desktop-slicer-filter-date-range#create-the-relative-date-range-filter

     

    You can download my test pbix file below

    Thank you very much!

     

    Best Regards,

    Community Support Team _Robert Qin

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

    • DimaMD's avatar
      DimaMD
      Solution Sage

      Hi v-robertq-msft 
      Thanks for the help, calculate the table works.
      I didn't think it was that easy

  • DimaMD  hi! 

    Do you have a date field in the origin table? So do a filter on today's date

     

    thx,

    B.

    • DimaMD's avatar
      DimaMD
      Solution Sage

      Hi, BeaBF  
      There is a date column, I also have other tables that are related to sales and contain products,
      I also have a product guide that I will use as a slicer.
      The customer wants to see in the slicer only the product that was sold on the current day, and is contained in other tables.

       

      We have a table, data from this table is downloaded from OLAP. This table consist of all historic data icluding current day. Then we copy this table, use filter to show data only for current date. I do this for a reason, because one table is used for "sales" comparison, and the other is used for us to be able to view current day  data. 

       

      The task is to create a virtual table, which will copy data from "historic" table, but only for current date. For example: 

      I have "table1" with data for year 2021 till current day. And I create a empty virtual "table2", where I need to copy data, only for current date, from "table1".

      Every day virtual "table2" needs to copy data for current day from "table1", so I need a DAX formula, which will create this virtual table.


      Why do I need this? I want to lower overall load on OLAP database and increase it's performance by not downloading same data twice.