Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
EmptyCarSpot
Frequent Visitor

Convert a text to date from a data source

Hi, I am new to power bi and I am occupying a data source to get my data, but using this form is very limited, no new columns can be made! :c, nor change the format of a field, it occurred to me to make a new measure that would bring the field but I don't know how to do it

EmptyCarSpot_0-1605622735107.png

My main objective is to find the difference between two days but I cannot work them without making a new column (option that is blocked) and I can only make measurements
If you can help me, I would appreciate it very much 

 

the dax i tried is: 

between_two_dates = DATEDIFF(Hoja1[Fecha HU en Progreso], Hoja1[Fecha HU Completada], DAY) 
but only works in columns, not in measure

 

 

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@EmptyCarSpot 

 

Try this way:

 

between_two_dates = DATEDIFF(MAX(Hoja1[Fecha HU en Progreso]), MAX(Hoja1[Fecha HU Completada]), DAY) 

 

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@EmptyCarSpot , This can work as measure , but you need push a row context

between_two_dates = DATEDIFF(max(Hoja1[Fecha HU en Progreso]), max(Hoja1[Fecha HU Completada]), DAY)

 

row context push , assume a column in table: rowkey (key in table)

sumx(values(Hoja1[rowkey?]), between_two_dates = DATEDIFF(max(Hoja1[Fecha HU en Progreso]), max(Hoja1[Fecha HU Completada]), DAY) 

 

or

 

Averagex(values(Hoja1[rowkey?]), between_two_dates = DATEDIFF(max(Hoja1[Fecha HU en Progreso]), max(Hoja1[Fecha HU Completada]), DAY) 

Fowmy
Super User
Super User

@EmptyCarSpot 

 

Try this way:

 

between_two_dates = DATEDIFF(MAX(Hoja1[Fecha HU en Progreso]), MAX(Hoja1[Fecha HU Completada]), DAY) 

 

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.