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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
sunny1284
Frequent Visitor

Calculation Reuired Date Filtering

Hi Experts ,

 

I am new to power bi and need help on the same on the calculation of relative filters between 2 or more date fields and show Sales Amount

Sum of Sales when 

1.Effective date within the date range selected(inclusive) and the Entry date is less than financial closing date for End of range selected

2. Effective date prior to the selection start date and entry date between financial opening date for Start of range selected and financial closing date for end of range selected(inclusive).

 

All dates are available in a single view .Hope someone helps me on the same .

 

Regards ,

Sunny 

 

 

1 ACCEPTED SOLUTION
V-lianl-msft
Community Support
Community Support

Hi @sunny1284 ,

 

It is very difficult to analyze without looking at the data and just by imagining. Based on your description, you could create measures to calculate data within the date range. You can refer to the DAX below:

Measure = 
CALCULATE ( 
	SUM ( table[SalesAmount] ),
	FILTER ( table, 
		table[Effective date] <= MAX ( table[Date] ) && 
		table[Effective date] >= MIN (table[Date]) &&
		table[Entry date]<= table[financial closing date]
	) 
)

if this is not the result you want, please provide some sample data or paste pictures, so that we can help you solve the problem.

 

Best Regards,

Liang 

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

View solution in original post

1 REPLY 1
V-lianl-msft
Community Support
Community Support

Hi @sunny1284 ,

 

It is very difficult to analyze without looking at the data and just by imagining. Based on your description, you could create measures to calculate data within the date range. You can refer to the DAX below:

Measure = 
CALCULATE ( 
	SUM ( table[SalesAmount] ),
	FILTER ( table, 
		table[Effective date] <= MAX ( table[Date] ) && 
		table[Effective date] >= MIN (table[Date]) &&
		table[Entry date]<= table[financial closing date]
	) 
)

if this is not the result you want, please provide some sample data or paste pictures, so that we can help you solve the problem.

 

Best Regards,

Liang 

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.