Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
When switching the year, quarter and month of the field parameters, I hope to get the maximum value of different time periods as the maximum value of the y-axis, but I can't get the maximum value dynamically. The maximum value corresponding to different time intervals can be calculated, but it can't be obtained dynamically. How can I get the maximum value of different time periods dynamically with DAX? That is, when I switch the year, quarter and month of the field parameter, the measurement can automatically obtain the maximum value of the corresponding interval
Solved! Go to Solution.
Hi,
I am not sure how your datamodel looks like, but I tried to create a sample pbix file like below.
Please check the below picture and the attached file.
As you can see in the measure, I tried to create additional column [Period CC] in the field parameter table, and then I used this column in the measure.
Max qty by period select measure: =
SWITCH (
SELECTEDVALUE ( Period[Period CC] ),
"M-Y", MAXX ( VALUES ( 'Calendar'[M-Y] ), [Quantity total measure:] ),
"Q-Y", MAXX ( VALUES ( 'Calendar'[Q-Y] ), [Quantity total measure:] ),
"Year", MAXX ( VALUES ( 'Calendar'[Year] ), [Quantity total measure:] )
)
Hi,
I am not sure how your datamodel looks like, but I tried to create a sample pbix file like below.
Please check the below picture and the attached file.
As you can see in the measure, I tried to create additional column [Period CC] in the field parameter table, and then I used this column in the measure.
Max qty by period select measure: =
SWITCH (
SELECTEDVALUE ( Period[Period CC] ),
"M-Y", MAXX ( VALUES ( 'Calendar'[M-Y] ), [Quantity total measure:] ),
"Q-Y", MAXX ( VALUES ( 'Calendar'[Q-Y] ), [Quantity total measure:] ),
"Year", MAXX ( VALUES ( 'Calendar'[Year] ), [Quantity total measure:] )
)
hi,kim,
thank you very much. Your suggestion is very helpful. According to your example, it is normal to create a column in the field parameter table for measurement judgment. If the original column in the field parameter table is used for judgment, the measurement will report an error. The original column that has been used before can not be found. Thank you again for your help
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
22 | |
7 | |
6 | |
6 | |
6 |
User | Count |
---|---|
27 | |
10 | |
10 | |
9 | |
6 |