Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hey I have this formula to filter my values on yesterday and if its monday it should display last friday. The problem is that I cant filter on date because the column is a date/time format with multiple times for the same date so the diagram appears empty for some reason. I think the solution to this problem is to either somehow say in my formula take all times in a certain date or to put all times to 00:00:00 in my column
formula now:
Solved! Go to Solution.
You are correct, the custom column somehow keeps the datetime format...
Change the custom column to this instead and it should work.
Timestamp = DATE(YEAR('Table (2)'[LOG_TIMESTAMP]); MONTH('Table (2)'[LOG_TIMESTAMP]);DAY('Table (2)'[LOG_TIMESTAMP]))
I'd say the easiest way to resolve this is just to make a copy of the [LOG_TIMESTAMP] column and format it to normal date which you then use instead in this calculation. If you don't want to make a copy of the column you can use the YEAR(), MONTH() and DAY() dax syntax to convert the timestamp to a plain date in the middle of the calculation.
Br,
J
hi @tex628
Yes, but how do I do this formatting? Do you have an example of a formula that does this or can you apply it to my formula I listed below? Making a copy of the column probably isn't that difficult but I'm stuck on the formatting. Not sure if it's easier to do on SQL level or PowerBI level.
Create a new column and reference the timestamp column.
Then convert the datatype of the column:
hi @tex628
This does not work for some reason my bar diagram remains empty. I did test if it could be the formula. When i remove the timestamp filter data is shown. So it is a problem with the date/time I think even if it is date datatype the time is still there but hidden since formatting removes it. Idk though
Edit: I changed it the way you said so it said for example 11/12/2019 then in my bar chart as axis i put timestamp then it works with value count of shipment_seq BUT when i use my formula even as simple as count seq with a filter that timestamp is today -1 and put it as value then my diagram is empty no clue why.
datetime formatted as 21/11/2019
So even after formatting PowerBI still see it as seperate values which explains why it is empty. I think either in DAX formula or in sql the time part needs to be stripped from the date part so 11/11/2019 can be filtered upon like normal dates are.
You are correct, the custom column somehow keeps the datetime format...
Change the custom column to this instead and it should work.
Timestamp = DATE(YEAR('Table (2)'[LOG_TIMESTAMP]); MONTH('Table (2)'[LOG_TIMESTAMP]);DAY('Table (2)'[LOG_TIMESTAMP]))
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
94 | |
80 | |
67 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |