Forum Discussion
Sekharnaga
2 years agoFrequent Visitor
Difference between current month and previous month Percentage
I have a monthwise Percentage data, when i filter month on the top, it is required to show the difference between current month and previous month Percentage. Please help with DAX function
- Anonymous2 years ago
Hi Sekharnaga ,
Based on your description, I created an example using this sample data:
Create measure, calculate the percentage for the current month of the current year.
MEASURE = VAR _month = SELECTEDVALUE ( 'financials'[Month Number] ) VAR _year = SELECTEDVALUE ( financials[Year] ) VAR _sum1 = CALCULATE ( SUM ( financials[ Sales] ), 'financials'[Month Number] = _month && 'financials'[Year] = _year ) VAR _sum2 = CALCULATE ( SUM ( financials[Gross Sales] ), 'financials'[Month Number] = _month && 'financials'[Year] = _year ) RETURN DIVIDE ( _sum1, _sum2 )
Create a measure, get the percent for the previous month, and calculate the difference.Measure2 = VAR _month = SELECTEDVALUE ( 'financials'[Month Number] ) VAR _year = SELECTEDVALUE ( financials[Year] ) VAR _sum1 = CALCULATE ( SUM ( financials[ Sales] ), 'financials'[Month Number] = _month - 1 && 'financials'[Year] = _year ) VAR _sum2 = CALCULATE ( SUM ( financials[Gross Sales] ), 'financials'[Month Number] = _month - 1 && 'financials'[Year] = _year ) VAR _pre = DIVIDE ( _sum1, _sum2 ) RETURN IF ( _pre = BLANK (), BLANK (), [MEASURE] - _pre )If your Current Period does not refer to this, please clarify in a follow-up reply.
Best Regards,
Clara Gong
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Sekharnaga
2 years agoFrequent Visitor
Hi, I already have created meassure for Percentage. Now i want one more table to show the differnce between previous month and current month.