Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
AnilGudap666
New Member

Return sum of sales value for min date in a month (month filter applied) and compare to other dates

Hi @ all,

                I am trying to calculate sum of sales value for min date in a month (month filter applied) and compare to other dates. Customer ID and month filters are applied.

Note: if the 1st date of the month has blank values the next day value should be returned.

Below is the table with expected resulted. Please help me in achiving it.

 

Date               Sales       Min Date Sales        %diff with min date sales
March 01           0                       0
March 02           0
March 03         300                  300                      100%
March 04         450                  300                       50%
March 05         600                  300                       200%
March 06         150                  300                      -50%

1 REPLY 1
amitchandak
Super User
Super User

@AnilGudap666 , Try a measure like

 

new Measure =
var _min = calculate(Min(Table[Date]) , filter(allselected(sales), [customer id] = max(sales[Customer id]) && table[sales]<> 0 && not(isblank(Table[Sales]))))
var _sales = calculate(Sum(Table[sales]) , filter(allselected(sales), [customer id] = max(sales[Customer id]) && table[sales]<> 0 &&Table[Date] =_min ))
return
divide(Sum(Table[sales]) -_sales,_sales)

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.