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.
I have a column with duplicate dates. I need to calculate date difference based on another column.
For example, I have Stage column with 1,2,3... repeated values . What will be function I can use to calculate date values differences for stage 1?
Thanks in Advance..
Solved! Go to Solution.
maybe you can try this
measure=calculate(max(lastdate),allexcept(table,bomno))-calculate(min(lastdate),allexcept(table,bomno))
Proud to be a Super User!
Thanks for your answers...
Days Diff Measure : =
VAR ranking =
RANKX (
FILTER ( ALL ( 'Table' ), 'Table'[Stage] = MAX ( 'Table'[Stage] ) ),
CALCULATE ( MAX ( 'Table'[Date] ) ),
,
ASC
)
VAR result =
DATEDIFF (
CALCULATE (
MAX ( 'Table'[Date] ),
FILTER (
ALL ( 'Table' ),
'Table'[Stage] = MAX ( 'Table'[Stage] )
&& RANKX (
FILTER ( ALL ( 'Table' ), 'Table'[Stage] = MAX ( 'Table'[Stage] ) ),
CALCULATE ( MAX ( 'Table'[Date] ) ),
,
ASC
) = ranking - 1
)
),
MAX ( 'Table'[Date] ),
DAY
)
RETURN
result
https://www.dropbox.com/s/rwbkhoz3ir6d789/erp.pbix?dl=0
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
pls provide some sample data and expected output.
Proud to be a Super User!
My sample data
So, I need days difference between first date and last date (in lastdate Column) based on bomno column.
Thanks in advance..
maybe you can try this
measure=calculate(max(lastdate),allexcept(table,bomno))-calculate(min(lastdate),allexcept(table,bomno))
Proud to be a Super User!
Need DAX(Power BI) for no of days for Each SGNo from the Above Table.
what's the expected output? it's better to create a new postand provide the detailed info.
Proud to be a Super User!
Thanks a lot. It worked for me...😊
you are welcome
Proud to be a Super User!
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 |
---|---|
106 | |
105 | |
88 | |
75 | |
66 |
User | Count |
---|---|
126 | |
111 | |
100 | |
83 | |
71 |