cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
hozefa New Member
New Member

Date condition DAX query

I have a 2 tables invoice amount and line amount and i have to calculate Total actual amount, Now condition for total actual amount is invoice amount till previous month of maximum planning date and  line amount from current month date.

P.S.   Planning date is in invoice amount table and future dates will be in line amount amount.

I need DAX condition to create a new column in line amount table to make all values of line amount  0 till previous month of maximum planning date.

 

lets assume i have max planning date in invoice amount table is 5th dec 2018, so In a new column in Line amount table values from start lets say 1st Jan 2016 till 31st Nov 2018 will be zero and and from 1 dec till end date it will be equal to line amount.

 

Urgently needed.

2 REPLIES 2
v-jiascu-msft Super Contributor
Super Contributor

Re: Date condition DAX query

Hi @hozefa,

 

Try the following formula, please. Or please share a sample without sensitive data.

 

Amount =
VAR maxPlanningDate =
    EOMONTH ( MAX ( 'invoice'[planning date] ), -1 )
RETURN
    IF ( [future dates] <= maxPlanningDate, 0, [line amount] )

 

Best Regards,
Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
v-jiascu-msft Super Contributor
Super Contributor

Re: Date condition DAX query

Hi @hozefa,

 

Could you please mark the proper answers as solutions?

 

Best Regards,

Dale

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

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

New Badges

Incoming: New and Improved Badges

Exciting news: We've given our badges an overhaul and added brand news ones.

Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 180 members 2,137 guests
Please welcome our newest community members: