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.
Hi comunity,
I've been working on power BI for some time now, and I like it very much, I have a problem with a function, maybe you can help me, I want to know the difference per user of the use dsize between the last two dates. El resultado lo muestre en otra tabla, con el nombre de usuario y la diferencia
I appreciate your help.
Solved! Go to Solution.
HI @Anonymous,
I try to extract datetime string from your source name column, but I found some records contains incorrect time value.
Calculate column formula:
DateTime characters = VAR trimSpace = SUBSTITUTE ( UPPER ( [Source.Name] ), " ", "" ) VAR removeUnder = SUBSTITUTE ( trimSpace, "_", "" ) RETURN PATHITEM ( SUBSTITUTE ( removeUnder, "LOCAL", "|" ), 1 )
I'd like to know last four characters means time value or just id? If it means time value, please share some correct sampel data here for test.
Sample:
Use calculated column to get date value from above text.
Date = VAR _date = LEFT ( [DateTime characters], 8 ) VAR _year = LEFT ( _date, 4 ) VAR _month = RIGHT ( LEFT ( _date, 6 ), 2 ) VAR _day = RIGHT ( _date, 2 ) RETURN DATE ( _year, _month, _day )
Measure of diff between previous and current:
Diff of previous = VAR previous = MAXX ( FILTER ( ALL ( 'sample' ), [Users] = SELECTEDVALUE ( 'sample'[Users] ) && [Date] < MAX ( 'sample'[Date] ) ), [Date] ) RETURN IF ( previous <> BLANK (), DATEDIFF ( previous, MAX ( 'sample'[Date] ), DAY ), 0 )
Result:
Regards,
Xiaoxin Sheng
HI @Anonymous,
I try to extract datetime string from your source name column, but I found some records contains incorrect time value.
Calculate column formula:
DateTime characters = VAR trimSpace = SUBSTITUTE ( UPPER ( [Source.Name] ), " ", "" ) VAR removeUnder = SUBSTITUTE ( trimSpace, "_", "" ) RETURN PATHITEM ( SUBSTITUTE ( removeUnder, "LOCAL", "|" ), 1 )
I'd like to know last four characters means time value or just id? If it means time value, please share some correct sampel data here for test.
Sample:
Use calculated column to get date value from above text.
Date = VAR _date = LEFT ( [DateTime characters], 8 ) VAR _year = LEFT ( _date, 4 ) VAR _month = RIGHT ( LEFT ( _date, 6 ), 2 ) VAR _day = RIGHT ( _date, 2 ) RETURN DATE ( _year, _month, _day )
Measure of diff between previous and current:
Diff of previous = VAR previous = MAXX ( FILTER ( ALL ( 'sample' ), [Users] = SELECTEDVALUE ( 'sample'[Users] ) && [Date] < MAX ( 'sample'[Date] ) ), [Date] ) RETURN IF ( previous <> BLANK (), DATEDIFF ( previous, MAX ( 'sample'[Date] ), DAY ), 0 )
Result:
Regards,
Xiaoxin Sheng
Hi
Thank you for your answer. The difference is for the "Used Size (MB)" column only for the two most recent dates, no time is required.
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 | |
83 | |
76 | |
65 |
User | Count |
---|---|
120 | |
111 | |
94 | |
83 | |
77 |