Forum Discussion

flaviobdsti's avatar
flaviobdsti
Helper I
3 years ago
Solved

Filter based metric sum

Hi Guys! Please I need your help! I have two measurements, LAST MONTH and CURRENT MONTH, both measures group sales values by CODE. When I put the two measures together with the CODE field in a t...
  • Ashish_Mathur's avatar
    Ashish_Mathur
    3 years ago

    Hi,

    This measure works.  Download the PBI file from here.

    Measure = SUMX(FILTER(SUMMARIZE(CALCULATETABLE(VALUES('Table'[ID]),DATESBETWEEN(dimCalendar[Date],EDATE(MIN(dimCalendar[Date]),-1),min(dimCalendar[Date])-1)),'Table'[ID],"A",[CURRENT_MONTH],"B",[LAST MONTH]),[A]=0&&[B]>0),[B])

    Hope this helps.