Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi Guys,
I am sure that an identical question was already raised, but I am quite new to Power Query Editor, hence I don't really know how to search for the answer. I have tried few solutions, but nothing seem to work (or I cannot really do it).
Anyway: data form SQL server, after some modeling we have:
Column on the left: employee ID (multiple for the same ID)
Column on the right: date (different for each line per ID)
What I would need to have in the 3rd column is minimum date value that appears for the given ID.
Thanks,
Lucjan
Solved! Go to Solution.
Hi @Lucjan_Szulik,
Don't know what you want to calculate but believe that the best way is to use measures because calculated columns have additional space to your model and complexity.
But the options you have for creating the column are DAX and M language see below both options.
DAX Calculated column:
Minimum Date Dax = CALCULATE ( MIN ( Dates_DAX[Date] ); FILTER ( Dates_DAX; Dates_DAX[ID] = EARLIER ( Dates_DAX[ID] ) ) )
M Language:
See below result for both columns and attach PBIX file.
Regards,
MFelix
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @Lucjan_Szulik,
Can you mark the proper answer as a solution please?
Best Regards,
Dale
Hi @Lucjan_Szulik,
Why fo you need to create a 3rd column?
If you only want to know what is the minimum date for a particular ID when you add it to a visual you can select the sumarization as MINIMUM, other way is to create a measure:
Minimum Date = MIN(Table[begin_valid_date])
And add it to your visuals then based on context if you add the ID's it will return the minimum value of the context given.
Regards,
MFelix
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi,
Need it for calculating absenteeism per seniority.
I have another table with scheduled hours and all the present/absenteeism. I need to add seniority of every agent on the given day and base on that build some visualizations.
Thanks,
Lucjan
Hi @Lucjan_Szulik,
Don't know what you want to calculate but believe that the best way is to use measures because calculated columns have additional space to your model and complexity.
But the options you have for creating the column are DAX and M language see below both options.
DAX Calculated column:
Minimum Date Dax = CALCULATE ( MIN ( Dates_DAX[Date] ); FILTER ( Dates_DAX; Dates_DAX[ID] = EARLIER ( Dates_DAX[ID] ) ) )
M Language:
See below result for both columns and attach PBIX file.
Regards,
MFelix
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsThis is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
72 | |
71 | |
55 | |
37 | |
31 |
User | Count |
---|---|
87 | |
62 | |
61 | |
49 | |
45 |