Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers!
Enter the sweepstakes now!See when key Fabric features will launch and what’s already live, all in one place and always up to date. Explore the new Fabric roadmap
how would i do this in Power BI Dax?
I have the following table containing 2 columns:
Date,Temperature
which contains multiple temperatures per day so multiple rows per day in the table
I am looking for the coldest date in 2022 and 2023 based on the temperature column. please advise.
Solved! Go to Solution.
Hi, @pbrosnan
You can try the following methods.
Measure = Var _mintem=CALCULATE(MIN('Table'[temperature]),ALL('Table'))
Return
CALCULATE(MAX('Table'[date]),FILTER(ALL('Table'),[temperature]=_mintem))
Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @pbrosnan possible solution: create 2 measures, one for identification of Min temp and finding date for this Min date. Edit Sheet1 to your table name
Did I answer your question? Kudos appreciated / accept solution!
Proud to be a Super User!
Hi @pbrosnan try with following measures per years. For Max date, just replace MINX with MAXX
Coldest_Date_year_2022 = MINX(
FILTER(yourtablename, YEAR(yourtablename[Date]) = 2022),
yourtablename[Date])
Coldest_Date_year_2023 = MINX(
FILTER(yourtablename, YEAR(yourtablename[Date]) = 2023),
yourtablename[Date])
Proud to be a Super User!
i need the date filter to be variable between 01-01-2022 and 31-12-2023. as i am using a date slicer as the filter.
Hi @pbrosnan so you want result as calculated column or something else. Please describe.
Proud to be a Super User!
i have a table containing these rows and columns:
date,temperature
01-01-2021,150
01-01-2021,120
02-01-2021,120
02-01-2021,110
03-01-2022,160
03-01-2022,170
05-01-2022,160
05-01-2022,180
i want to return the date that has the lower temperature which is 02-01-2021 so how do i calculate it? there are multiple temperatures per day.
Hi, @pbrosnan
You can try the following methods.
Measure = Var _mintem=CALCULATE(MIN('Table'[temperature]),ALL('Table'))
Return
CALCULATE(MAX('Table'[date]),FILTER(ALL('Table'),[temperature]=_mintem))
Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
User | Count |
---|---|
19 | |
18 | |
15 | |
13 | |
13 |
User | Count |
---|---|
9 | |
8 | |
8 | |
6 | |
6 |