cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ganesanr30
Regular Visitor

Please Help us to Solve the measure

Hi,

I am trying to get per day revenue based on the given start_date and end_date .Can anybody help to try to get in measure .

 

Revenue Per day.PNG

 

Eg : I want to view the invoice amount for the any intermediate date (Say From Date 01-06-2021 to 30-06-2021 Result will be 32.60 for Invoice number 1) 

Kindly Help us to solve in measure 

thanks in advance  

1 ACCEPTED SOLUTION
Jihwan_Kim
Community Champion
Community Champion

Hi, @ganesanr30 

I am not sure how your desired outcome looks like, but please check the below picture and the sample pbix file's link down below.

All measures are in the sample pbix file.

 

I suggest having a dim-date table like below.

 

Picture1.png

 

Amount Total Step 1 =
CALCULATE (
SUMX (
VALUES ( Dates[Date] ),
SUMX (
Invoices,
Invoices[Amt]
/ ( DATEDIFF ( Invoices[Start_Date], Invoices[End_Date], DAY ) + 1 )
)
),
FILTER (
Invoices,
Invoices[Start_Date] <= MAX ( Dates[Date] )
&& Invoices[End_Date] >= MIN ( Dates[Date] )
)
)
 
 
Amount Total step 2 =
SUMX ( VALUES ( Dates[Date] ), [Amount Total Step 1] )
 
 
 
 

Hi, My name is Jihwan Kim.


If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM


If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

Best regards, JiHwan Kim

Linkedin: https://www.linkedin.com/in/jihwankim1975/

Twitter: https://twitter.com/Jihwan_JHKIM

View solution in original post

2 REPLIES 2
Jihwan_Kim
Community Champion
Community Champion

Hi, @ganesanr30 

I am not sure how your desired outcome looks like, but please check the below picture and the sample pbix file's link down below.

All measures are in the sample pbix file.

 

I suggest having a dim-date table like below.

 

Picture1.png

 

Amount Total Step 1 =
CALCULATE (
SUMX (
VALUES ( Dates[Date] ),
SUMX (
Invoices,
Invoices[Amt]
/ ( DATEDIFF ( Invoices[Start_Date], Invoices[End_Date], DAY ) + 1 )
)
),
FILTER (
Invoices,
Invoices[Start_Date] <= MAX ( Dates[Date] )
&& Invoices[End_Date] >= MIN ( Dates[Date] )
)
)
 
 
Amount Total step 2 =
SUMX ( VALUES ( Dates[Date] ), [Amount Total Step 1] )
 
 
 
 

Hi, My name is Jihwan Kim.


If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM


If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

Best regards, JiHwan Kim

Linkedin: https://www.linkedin.com/in/jihwankim1975/

Twitter: https://twitter.com/Jihwan_JHKIM

View solution in original post

Fowmy
Super User IV
Super User IV

@ganesanr30 

Hope you have a dates table, if not create one and connect to your data table and add the following measure:

amount =
VAR __start =
    MIN ( dates[date] )
VAR __end =
    MAX ( dates[date] )
RETURN
    SUMX (
        FILTER ( table, table[startdate] >= __start && table[enddate] <= __end ),
        table[amt]
    )
Did I answer your question? Mark my post as a solution! and hit thumbs up


Blog - Data Visualization

Website   YouTube    LinkedIn   PBI User Group

Helpful resources

Announcements
MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

July 2021 Update 768x460.png

Check it out!

Click here to read more about the July 2021 Updates

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Urdu Hindi D365 Bootcamp 768x460.png

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Top Solution Authors