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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Zyg_D
Continued Contributor
Continued Contributor

Subtracting data from predefined base date

This measure is expected for every date (6 of them) to take SUM(dfMain[a3_invoiced units]) and subtract the same from DATE(2020,9,21) . In the graph I see that the subtraction only happens on the first date (result = 0) . How to make the subtraction work for other dates?

 

 

_m_A3_growth_cumul = 
VAR _base = DATE (2020,9,21)
VAR _a3_sum_base = SUMX ( FILTER ( dfMain,dfMain[Date] = _base ),
                          dfMain[a3_invoiced units] )
VAR _a3_sum = SUM(dfMain[a3_invoiced units])
VAR _a3_diff = _a3_sum - _a3_sum_base
RETURN _a3_diff

 

 

 Capture.PNG

1 ACCEPTED SOLUTION
v-deddai1-msft
Community Support
Community Support

Hi @Zyg_D ,

 

Please refer to the following measure:

 

 

_m_A3_growth_cumul = 
VAR _base = DATE (2020,9,21)
VAR _a3_sum_base = SUMX ( FILTER ( all(dfMain),dfMain[Date] = _base ),
                          dfMain[a3_invoiced units] )
VAR _a3_sum = SUM(dfMain[a3_invoiced units])
VAR _a3_diff = _a3_sum - _a3_sum_base
RETURN IF( ISBLANK(_a3_sum),BLANK(),_a3_diff)

 

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards,

Dedmon Dai

 

View solution in original post

5 REPLIES 5
v-deddai1-msft
Community Support
Community Support

Hi @Zyg_D ,

 

Please refer to the following measure:

 

 

_m_A3_growth_cumul = 
VAR _base = DATE (2020,9,21)
VAR _a3_sum_base = SUMX ( FILTER ( all(dfMain),dfMain[Date] = _base ),
                          dfMain[a3_invoiced units] )
VAR _a3_sum = SUM(dfMain[a3_invoiced units])
VAR _a3_diff = _a3_sum - _a3_sum_base
RETURN IF( ISBLANK(_a3_sum),BLANK(),_a3_diff)

 

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards,

Dedmon Dai

 

v-deddai1-msft
Community Support
Community Support

Hi @Zyg_D ,

 

Would you please try to use the following measure:

 

 

_m_A3_growth_cumul = 
VAR _base = DATE (2020,9,21)
VAR _a3_sum_base = SUMX ( FILTER ( ALL(dfMain),dfMain[Date] = _base ),
                          dfMain[a3_invoiced units] )
VAR _a3_sum = SUM(dfMain[a3_invoiced units])
VAR _a3_diff = _a3_sum - _a3_sum_base
RETURN _a3_diff

 

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards,

Dedmon Dai

Zyg_D
Continued Contributor
Continued Contributor

Thanks, Dedmon Dai ( @v-deddai1-msft ).

Now subtraction seems to be working, However it also gives me all the dates from the Dates table. Any idea how I can keep only the 6 dates for which I have data? Or limit the subtraction to not be applied to all of the dates? 

Capture.PNG

amitchandak
Super User
Super User

@Zyg_D , We do not have access to file.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
amitchandak
Super User
Super User

@Zyg_D ,Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors