Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
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 table, I have the result of the image below.
But now I need to create a measure that presents me the sum of the LAST MONTH column only when the respective
row of the CURRENT MONTH column is empty.
Can anyone help me?
Below my measurements:
CURRENT MONTH = CALCULATE(SUM(SALES[AMOUNT]),GROUPBY(ID, ID[CODE]))
LAST MONTH = CALCULATE([CURRENT MOTH],DATEADD(CALENDAR[DATE],-1,MONTH))
Solved! Go to Solution.
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.
hi @flaviobdsti
could you provide a minimum viable sample datasets for all the relevant tables and columns?
Thank you for answering my message
I created a .pbix file as an example. I put it in a repository, in the link below:
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.
Hi Ashish Mathur,
I hope someday achieve your level. Thank you so much for your help. Worked perfectly!
You are welcome. Thank you for your kind words.
Hi,
Not sure how much i can help but i would like to try.
Hi Ashish_Mathur
the problem is that this table is generated only from the insertion of the CODE column and the measures in this "virtual" table. My attempts to carry out a filter in measurements have failed. I would need something like, If the CURRENT MONTH column is equal to Blank() then it sums the corresponding values of the LAST MONTH column. And at the end I need to put the result on a card.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.