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.
Good.
I'm trying to subtract two dates, but I can't, since when creating the measure it doesn't show me the date fields of the table I need, my measurement would be:
difference = DATEDIFF( Contracts[FROM]:, Dcontratos[UNTIL], DAY)
In the following screenshot you can see how I have defined the dates:
Format
when creating the measure I do not see the from field:
Structure and representation
What's wrong?
Thanks a lot.
Solved! Go to Solution.
@Syndicate_Admin No, I mean something like this:
diff_measure=var startDate=MIN([DESDE:])
var endDate=MAX([HASTA:])
return DATEDIFF(startDate,endDate,DAY)
Variables startDate and endDate you can define in any other way. But using variables you doesn't need DATEDIFF function to substract two dates, you can just substract those variables:
diff_measure=var startDate=MIN([DESDE:])
var endDate=MAX([HASTA:])
return endDate-startDate
@Syndicate_Admin In DATEDIFF function you have to use single value dates instead of date columns. Use variable to define start/end dates and then use them in the function.
Good you mean this:
I put it like that, but it still doesn't leave me.
@Syndicate_Admin No, I mean something like this:
diff_measure=var startDate=MIN([DESDE:])
var endDate=MAX([HASTA:])
return DATEDIFF(startDate,endDate,DAY)
Variables startDate and endDate you can define in any other way. But using variables you doesn't need DATEDIFF function to substract two dates, you can just substract those variables:
diff_measure=var startDate=MIN([DESDE:])
var endDate=MAX([HASTA:])
return endDate-startDate
Hello my problem is when choosing the format of the measurement data. It doesn't let me choose more than dates. No numbers, can you help me?
Resolved with Convert (Date, Integer)
OK, with the alegro.
Have you tried to change the data type to number, from Power Query?
Thank you very much, it has worked for me, I have finally used the today in Star to calculate today.
Greetings
It is already accepted.
Greetings
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 |
---|---|
109 | |
99 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
101 | |
86 | |
64 |