Forum Discussion
Max range axis
- 3 years ago
Hi Anonymous ,
Please try:
MAX VALUE2 = var _a = CALCULATE(SUM('Case'[Actual]),FILTER(ALLEXCEPT('Case','Case'[Date]),[EBITDA]="EBITDA")) var _b = CALCULATE(SUM('Case'[Forecast]),FILTER(ALLEXCEPT('Case','Case'[Date]),[EBITDA]="EBITDA")) var _c = CALCULATE(SUM('Case'[Actual]),FILTER(ALLEXCEPT('Case','Case'[Date]),[Cash Flow]="Cash Flow")) var _d = CALCULATE(SUM('Case'[Forecast]),FILTER(ALLEXCEPT('Case','Case'[Date]),[Cash Flow]="Cash Flow")) return MAXX({_a,_b,_c,_d},[Value])Final output:
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi v-jianboli-msft , greatly appreciate your help!
I tried it in my main dashboard, one thing is my data has quite a number of other fields/filters, and the max range remained large after selecting various filters.
One such field example is date which I have added to the 'case' example:
Would it be possible to make the max range dynamic, such that the max range follows the various filters:
Thank you.
Hi Anonymous ,
Please try:
MAX VALUE2 =
var _a = CALCULATE(SUM('Case'[Actual]),FILTER(ALLEXCEPT('Case','Case'[Date]),[EBITDA]="EBITDA"))
var _b = CALCULATE(SUM('Case'[Forecast]),FILTER(ALLEXCEPT('Case','Case'[Date]),[EBITDA]="EBITDA"))
var _c = CALCULATE(SUM('Case'[Actual]),FILTER(ALLEXCEPT('Case','Case'[Date]),[Cash Flow]="Cash Flow"))
var _d = CALCULATE(SUM('Case'[Forecast]),FILTER(ALLEXCEPT('Case','Case'[Date]),[Cash Flow]="Cash Flow"))
return MAXX({_a,_b,_c,_d},[Value])
Final output:
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Anonymous3 years agoNot applicable
Hi v-jianboli-msft ,
Sorry for the delayed reply.
I have tried it, and I realise I should have mentioned, our data tables look something like this.
As we have many data tables, we have used a centralised date table as our filter (we also have several other filters):
I had added a date table:
I used this DAX and set it as the max axis for both charts:
MAX VALUE =var _a = CALCULATE(SUM('Case'[Actual]),FILTER(ALLEXCEPT('Date','Date'[Date]),'Date'[test]>0))var _b = CALCULATE(SUM('Case'[Forecast]),FILTER(ALLEXCEPT('Date','Date'[Date]),'Date'[test]>0))return MAXX({_a,_b},[Value])However, the axis does not show the same:Would it still work for filters that come from related tables?
Thank you.