Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
The company I work for has data sets for us to work with, and in one of those data sets is a certain date/time variable. Let's call it DATEX.
I want to use this variable in another table, but only the date portion, not the time. So right now my DAX sort of looks like this:
SUMMARIZE(
VARIABLEZ
DATEX)
But: it's showing the date and time for DATEX, since it's a date/time variable. I can't change the data type in the source (DATEX), my company has disallowed this. How do I put DATEX in the table using only the date?
Thank you.
Solved! Go to Solution.
Hi @rsch91 ,
Based on the description, creating a calculated column.
FormattedDATEX = FORMAT('Table'[DATEX], "yyyy-mm-dd")
Then, creating a new table.
NewTable =
SUMMARIZE(
'Table',
'Table'[FormattedDATEX]
)
Besides, creating a new calculated column.
NewCalculatedColumn =
IF(
NETWORKDAYS(MIN('Table'[DATEX]), NewTable[FormattedDATEX], 1, {DATE(2024,11, 6)}) < 0,
BLANK(),
NETWORKDAYS(MIN('Table'[DATEX]), NewTable[FormattedDATEX], 1, {DATE(2024,11,6)})
)
Best Regards,
Wisdom Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @rsch91 ,
Based on the description, creating a calculated column.
FormattedDATEX = FORMAT('Table'[DATEX], "yyyy-mm-dd")
Then, creating a new table.
NewTable =
SUMMARIZE(
'Table',
'Table'[FormattedDATEX]
)
Besides, creating a new calculated column.
NewCalculatedColumn =
IF(
NETWORKDAYS(MIN('Table'[DATEX]), NewTable[FormattedDATEX], 1, {DATE(2024,11, 6)}) < 0,
BLANK(),
NETWORKDAYS(MIN('Table'[DATEX]), NewTable[FormattedDATEX], 1, {DATE(2024,11,6)})
)
Best Regards,
Wisdom Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
for date format you can add calculated columnn using this dax:
Formatteddate = FORMAT([datecolumn], "MM/DD/YYYY")
you will get thiss format:
11/05/2024
Thanks! That has worked. I created a column called "formatted DATEX" Now how do I work with DATEX to create a new column in the same new table?
@rsch91
you can refer the new column in your dax instead of old datecolumn, it will be similar to your datetime column just that it wont have time part, only dates.
The thing is, it won't let me refer to the new column in the IF-formula.
why?
have you tried using format function for date format?
I am an absolute newbie to DAX, could you show me how to use it? Thank you.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 41 | |
| 37 | |
| 35 | |
| 35 | |
| 28 |
| User | Count |
|---|---|
| 134 | |
| 101 | |
| 71 | |
| 67 | |
| 65 |