The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi friends
i have a table like this
Name | Date | Compare time | Check |
John | 01-07-20 5:00 | 01-07-20 18:00 | |
John | 01-07-20 10:00 | ||
John | 01-07-20 19:00 | John | |
John | 02-07-20 3:00 | John | |
John | 02-07-20 9:00 | 02-07-20 22:00 | |
John | 02-07-20 11:00 | ||
Ron | 03-07-20 14:00 | 04-07-20 3:00 | |
Ron | 03-07-20 17:00 | ||
Ron | 03-07-20 20:00 | ||
Ron | 03-07-20 21:00 | ||
Ron | 04-07-20 5:00 | Ron |
how i create the check column that will show name in its in case of date are after latest compare time indivisually
Solved! Go to Solution.
Hi @Anonymous ,
First go to query editor>add column>index column;
Then create a measure as below:
Measure =
var _maxcomparetime=CALCULATE(MAX('Table'[Compare time]),FILTER(ALL('Table'),'Table'[Name]=MAX('Table'[Name])&&'Table'[Index]<=MAX('Table'[Index])))
Return
IF(MAX('Table'[Date])>_maxcomparetime,MAX('Table'[Name]),BLANK())
Finally you will see:
For the related .pbix file,pls see attached.
Hi @Anonymous ,
First go to query editor>add column>index column;
Then create a measure as below:
Measure =
var _maxcomparetime=CALCULATE(MAX('Table'[Compare time]),FILTER(ALL('Table'),'Table'[Name]=MAX('Table'[Name])&&'Table'[Index]<=MAX('Table'[Index])))
Return
IF(MAX('Table'[Date])>_maxcomparetime,MAX('Table'[Name]),BLANK())
Finally you will see:
For the related .pbix file,pls see attached.
@v-kelly-msft thanks you so much and nice description, i will try your advices on my BI asap.
Hi @Anonymous ,
OK,if it helps solve the issue,could you pls mark the reply as answered to close it?😊
Much appreciated.
@Anonymous , Try a new column like
new colum =
var _date = maxx(filter(Table,Table,[Name] = earlier([Name]) && [date].date =earlier([date]).date),[Compare time])
return
if([Date]>_date, [Name], blank())
If earlier([date]).date do not work then have date column first
new date = [date].date
new colum =
var _date = maxx(filter(Table,Table,[Name] = earlier([Name]) && [new date] =earlier([new date])),[Compare time])
return
if([Date]>_date, [Name], blank())
thank for your solution but i have a little condition that if rows are shuffle and didnt sorted by date, what should i do? @amitchandak
@amitchandak in case of first row of compare time is blank, how you do adjusted DAX?
@Anonymous
try to fill down for comparedate column
then create a column
Column = if(Sheet12[Compare time]<='Sheet12'[Date ],Sheet12[Name],blank())
Proud to be a Super User!
thank you @ryan_mayu for your answer but is it possible to use only DAX?
because compare time are calulated column
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
108 | |
82 | |
77 | |
46 | |
39 |
User | Count |
---|---|
137 | |
108 | |
69 | |
64 | |
53 |