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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
ironboy0423
Helper I
Helper I

How can we sum values based on selected date range but with certain filters need to consider

My current formula aggregates everything when two identical ids are included in the date range selected:

 

 

 

 

 

 

 

 

 

 

Total Amount = 
CALCULATE(
    SUM('Amounts'[Amount]),
    USERELATIONSHIP(Date[CalendarDate],'Amounts'[Date])
)

 

 

 

 

 

 

 

 

 

 

Sample dataset:

IdDateStatusAmount
10005101/02/2023Submitted5000
10005128/02/2023Registered2000
10005226/02/2024Registered300
10005228/02/2024Submitted5000
10005315/02/2024Registered1000
10005416/01/2024Registered2500
10005516/02/2024Registered1600
10005624/02/2024Registered800
10005710/01/2024Registered900

 

The objective or output needed is to aggregate only distinct ids based on latest status and date range selected but still need to display all of the rows. For example I filter data from  01/02/2023 to 10/02/2023. It should sum the values for this date range including the 01/02/2023 entry for Id 100051. Would that be possible? Just the total values we need to have corrected.

1 REPLY 1
lbendlin
Super User
Super User

Keep the tables disconnected. Read about TREATAS, and then use it with the VALUES from your date slicer to filter your fact table.

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

August Carousel

Fabric Community Update - August 2024

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