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 All,
I am looking to calculate the value of a Label filed about the the min value and max date.
Below is the sample data.
I need to calculate the Month Label about Max[Date] about Min[Value]
Year Month | Value | Month Label | Date |
201601 | 13 | Jan/16 | 01/01/2016 04:00:00 |
201411 | 10 | Nov/14 | 02/11/2014 02:00:00 |
201502 | 10 | Feb/15 | 16/02/2015 07:00:00 |
201501 | 10 | Jan/15 | 05/01/2015 05:00:00 |
201508 | 11 | Aug/15 | 05/08/2015 02:00:00 |
201511 | 11 | Nov/15 | 01/11/2015 03:00:00 |
201512 | 12 | Dec/15 | 01/12/2015 04:00:00 |
I use this Dax Formula:
Measure Month Label= MINX(
KEEPFILTERS(VALUES('Table'[Month Label]));
CALCULATE(MAX('Table'[Month Label]);FILTER('Table';'Table'[Value]=min('Table'[Value]))))
Measure Day = MINX(
KEEPFILTERS(VALUES('Table'[Date]));
CALCULATE(MAX('Table'[Date]);FILTER('Table';'Table'[Value]=min('Table'[Value]))))
The result is:
Measure Day | Measure Month Label |
16/02/2015 07:00:00 | Nov/14 |
but I expect the result is
Measure Day | Measure Month Label |
16/02/2015 07:00:00 | Feb/15 |
Measure Day is correct becouse is max about Date while Measure Month Label is not correct becouse is max about a string.
I'm sure it's likely a simple solution and any help you can provide will be appreciated.
Thanks a lot
Luca
You can format date to get month , of use dates in values or try to use date to get month
Measure Month Label= MINX(
KEEPFILTERS(VALUES('Table'[Month Label]));
CALCULATE(MAX('Table'[Date]);FILTER('Table';'Table'[Value]=min('Table'[Value]))))
Measure Month Label=
var _day =MINX(
KEEPFILTERS(VALUES('Table'[Date]));
CALCULATE(MAX('Table'[Date]);FILTER('Table';'Table'[Value]=min('Table'[Value]))))
return
MINX(
KEEPFILTERS(VALUES('Table'[Month Label]));
CALCULATE(MAX('Table'[Date]);FILTER('Table';'Table'[Date]=_day)));
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges
Connect on Linkedin
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 |
---|---|
107 | |
100 | |
80 | |
63 | |
58 |
User | Count |
---|---|
148 | |
111 | |
94 | |
84 | |
67 |