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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

selecting range date where measure is different from date to date is not summing up values

Hello everyone

table.png


i have 2 formulas inside my measure

old way = SUM(RevenueTable[Total])

this was the formula from beginning of my dataset until october 3 2022

so on october 3 2022 and forth, 
new formula = SUMX(Revenuetable2,[QTTY] * [Amount])



so my measure is 
total revenue = 

VAR oldway = IF(MAXX(ALLSELECTED('Calendar Table'),'Calendar Table'[Date]) < DATE(2022,10,3) ,SUM(RevenueTable[Total]),0)
VAR newway = IF(MAXX(ALLSELECTED('Calendar Table'),'Calendar Table'[Date]) >= DATE(2022,10,3) ,SUMX(Revenuetable,[QTTY] * [Amount]),0)
VAR revenue =
oldway + newway


it work fine on single selected date 

but if i selected from september 26 to october 9, 
it wont give me the sum of both


if selected october 3 and above, it gave me new correct:

 

new.png


if selected september 26 till october 2 give me old corrrect :

old.png


now if i select all, it gives me this:

Screenshot 2022-10-14 031641.png


as you see it wont give me the sum it just gives me the new formula is apllied


please help


1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Try a measure like , Unsing filter add both

 

calculate(SUM(RevenueTable[Total]),Filter('Calendar Table','Calendar Table'[Date] < DATE(2022,10,3) )) +

calculate(SUMX(Revenuetable,[QTTY] * [Amount]),Filter('Calendar Table','Calendar Table'[Date] >=  DATE(2022,10,3) ))

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@Anonymous , Try a measure like , Unsing filter add both

 

calculate(SUM(RevenueTable[Total]),Filter('Calendar Table','Calendar Table'[Date] < DATE(2022,10,3) )) +

calculate(SUMX(Revenuetable,[QTTY] * [Amount]),Filter('Calendar Table','Calendar Table'[Date] >=  DATE(2022,10,3) ))

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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