Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello All,
I'm wanting to return the max monthnumber for each year. For the example below 2018 would return 12 AND 2019 will return 9. I will then be using that calculation to divide a measure to get a average for the year.
Solved! Go to Solution.
@Anonymous ,
Create a below meaure to get Max monthnumber.
| 1 | 2018 |
| 10 | 2018 |
| 11 | 2018 |
| 12 | 2018 |
| 6 | 2018 |
| 7 | 2018 |
| 5 | 2018 |
| 9 | 2019 |
| 4 | 2019 |
| 1 | 2019 |
| 2 | 2019 |
| 3 | 2019 |
| 5 | 2019 |
Hey,
Here is two forumulas you can use either.
1.Maxmonth = MAX('Table'[Number])
2.MaxMonth = CALCULATE(MAX('Table'[Number]),FILTER('Table','Table'[Year]=SELECTEDVALUE('Table'[Year])))
Thanks,
Venkata Nalla
@Anonymous ,
Create a below meaure to get Max monthnumber.
@Anonymous ,
No, I am getting the 9 for 2019 and 12 for 2018. Refer below screen shot.
Don't forget to hit Thumbs up and accept this as a solution if you find it helpful!
So it may helps other!
is your monthnumber and year a date field ?
This is my calculation:
@Anonymous ,
Both fields are in numeric form(Whole number). You didn't mention about the Year is coming from different table. FOr this make a proper relationship betweeb those table.
Don't forget to hit Thumbs up and accept this as a solution if you find it helpful!
Thanks I changed to a whole number and it worked !
Great @Anonymous !
I will really appreciate your KUDOS/Thumbs up! 😊
Good Luck!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 38 | |
| 38 | |
| 28 | |
| 27 |
| User | Count |
|---|---|
| 124 | |
| 88 | |
| 73 | |
| 66 | |
| 65 |