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 everyone,
I'm trying to recreate the following in Power BI - and while I've gotten close - I can't figure out how to pull the month names I want as well.
What I want: to return the "record" (max) rainfall per month and the year which that record corresponds to.
@FLHound Sorry, having trouble following, can you post sample data as text and expected output?
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882
Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.
@Greg_Deckler Hi, sorry for not being clear enough
My sample data is below
I'm hoping to return the max value per month and the year in which that value corresponds to, so "10.9" & "2016" for January, "11.6" & "2020" for July, etc.
Month | January | February | March | April | May | June | July | August | September | October | November | December |
2016 | 10.9 | 3.5 | 1.9 | 0.4 | 5.8 | 3.7 | 4.7 | 10.8 | 7.6 | 5.0 | 0.0 | 0.6 |
2017 | 1.8 | 0.8 | 0.6 | 1.8 | 5.2 | 17.4 | 9.2 | 6.8 | 16.8 | 8.6 | 1.1 | 1.7 |
2018 | 1.1 | 0.3 | 0.5 | 4.2 | 12.0 | 8.5 | 8.1 | 6.3 | 5.3 | 1.5 | 1.6 | 1.1 |
2019 | 6.1 | 1.3 | 1.8 | 1.6 | 7.0 | 7.6 | 8.9 | 10.7 | 1.6 | 5.5 | 1.5 | 2.8 |
2020 | 1.2 | 2.3 | 0.4 | 3.7 | 6.3 | 8.7 | 11.6 | 7.3 | 8.6 | 8.0 | 6.7 | 3.1 |
2021 | 0.3 | 1.3 | 0.9 | 3.2 | 1.0 | 10.2 | 6.1 | 4.6 | 8.1 | 4.1 | 3.0 | 1.2 |
2022 | 1.4 | 0.9 | 1.4 | 2.7 | 6.5 | 11.0 | 4.6 |
@FLHound If that is how your source data looks, I would highly recommend unpivoting your month columns. If you do that, then you could do this:
Measure =
VAR __Month = MAX('Table'[Month])
VAR __Max = MAXX(FILTER('Table', [Month] = __Month),[Value])
RETURN
__Max
Measure 2 =
VAR __Month = MAX('Table'[Month])
VAR __Max = MAXX(FILTER('Table', [Month] = __Month),[Value])
RETURN
MAXX(FILTER('Table', [Month] = __Month && [Value] = __Max),[Year])
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 |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |