Forum Discussion
Anonymous
4 years agoNot applicable
Need help with DAX
Hey Everyone, I need your help. I have a table with Recording details by month and I would like to see the difference based on slicer selection. User has to select two Months in a slicer to com...
- 4 years ago
Anonymous There is if you unpivot those month columns so that you have:
Month, Value
March, 1200
April, 1500
...
You could then do this:
Difference Measure = VAR __Min = MIN('Table'[Month]) VAR __Max = MAX('Table'[Month]) VAR __Month1 = MAXX(FILTER('Table',[Month] = __Min),[Recordings]) VAR __Month2 = MAXX(FILTER('Table',[Month] = __Max),[Recordings]) RETURN __Month2 - __Month1In reality, you will want a MonthSort column for Sort By and probably have to use that for your max/min, etc.
Greg_Deckler
Community Champion
4 years agoAnonymous There is if you unpivot those month columns so that you have:
Month, Value
March, 1200
April, 1500
...
You could then do this:
Difference Measure =
VAR __Min = MIN('Table'[Month])
VAR __Max = MAX('Table'[Month])
VAR __Month1 = MAXX(FILTER('Table',[Month] = __Min),[Recordings])
VAR __Month2 = MAXX(FILTER('Table',[Month] = __Max),[Recordings])
RETURN
__Month2 - __Month1
In reality, you will want a MonthSort column for Sort By and probably have to use that for your max/min, etc.
- Anonymous4 years agoNot applicable
Hi Greg_Deckler ,
Really appreciate your help, that is definately best solution.
But what if I change the data little bit as below:
Can you pls help with this too Greg_Deckler ?