Forum Discussion
Date column is not being converted properly while importing from an excel
- Anonymous2 years ago
Hi Avivek ,
The date format is related with your location you set up. You can use "Using Locale..." to fix it.
Below is an example, my default format for dates is MM/DD/YYYY. So DD/MM/YYYY dates are imported in and text is displayed.
If your DD does not exceed 12 days, then the import may detect the date as MM/DD/YYYY, i.e. the month and days are reversed.
For the column you want to reformat the date, right-click and select Using Locale...
Select the Data Type as Date and Locale as the location you want. Here I selected English( United Kingdom) which date format is DD/MM/YYYY. You can see the sample input values for reference.
Note that before using Using Locale, restore the date to text format before working with it.
For calcualting the current sales, you can try creating the following measure.
Current Week Sales = CALCULATE(SUM('Table (2)'[Value]), DATESBETWEEN('Table (2)'[Date], TODAY() - WEEKDAY(TODAY(), 2) + 1, TODAY()))If you want to return the total for all rows in the table visual. You can modify as
Current Week Sales = CALCULATE(SUM('Table (2)'[Value]), DATESBETWEEN('Table (2)'[Date], TODAY() - WEEKDAY(TODAY(), 2) + 1, TODAY()),ALLSELECTED('Table (2)'))Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Avivek ,
The date format is related with your location you set up. You can use "Using Locale..." to fix it.
Below is an example, my default format for dates is MM/DD/YYYY. So DD/MM/YYYY dates are imported in and text is displayed.
If your DD does not exceed 12 days, then the import may detect the date as MM/DD/YYYY, i.e. the month and days are reversed.
For the column you want to reformat the date, right-click and select Using Locale...
Select the Data Type as Date and Locale as the location you want. Here I selected English( United Kingdom) which date format is DD/MM/YYYY. You can see the sample input values for reference.
Note that before using Using Locale, restore the date to text format before working with it.
For calcualting the current sales, you can try creating the following measure.
Current Week Sales = CALCULATE(SUM('Table (2)'[Value]), DATESBETWEEN('Table (2)'[Date], TODAY() - WEEKDAY(TODAY(), 2) + 1, TODAY()))
If you want to return the total for all rows in the table visual. You can modify as
Current Week Sales = CALCULATE(SUM('Table (2)'[Value]), DATESBETWEEN('Table (2)'[Date], TODAY() - WEEKDAY(TODAY(), 2) + 1, TODAY()),ALLSELECTED('Table (2)'))
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.