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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
Anonymous
Not applicable

Add 6 months to project start date and sum revenue during/outside those dates

Hi all,

 

I'm trying to show the end date of a particular project (always 6 months after start), based on whatever site the user selects. When no site is selected, the card should read "Select a site".

 

PricingProj Date.png

I thought this would work but it's telling me that multiple values were supplied:

PricProj Date +6 Mths = IF(ISFILTERED(MD_Sites[Site_Name]),
                            (DATEADD(MD_Sites[Pricing_Project_Date].[Date], +6, MONTH)),
                            "Select a Site")

 

 

I want to be able to calculate when a certain "treatment code" was used within the project dates and outside it - and what the value was for its usage inside the project dates and outside the project dates. Obviously this can only be done at an individual site level as each site has a different project start date (some also have no project start date).

 

This was my attempt at the sum:

 

 

Authorised 13D-25 Rev = 
VAR Pricing_Project_Date = CALCULATE(FIRSTDATE(MD_Sites[Pricing_Project_Date]))
VAR Pricing_project_6Mths = CALCULATE(DATEADD(MD_Sites[Pricing_Project_Date], +6, MONTH))
RETURN
CALCULATE(SUMX(REV_Revenue,REV_Revenue[Fee]),
                            FILTER(REV_Revenue,
                            REV_Revenue[TransactionDate] >= Pricing_Project_Date &&
                            REV_Revenue[TransactionDate] <= Pricing_project_6Mths
                            )
)

 

This is how my site table looks:


PricingProj SiteTable.png

 

My revenue table has line by line transactions with transaction date.

 

Any help would be much appreciated!

 

Kind regards,

Aaron

 

1 REPLY 1
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Anonymous ,

If I understand your scenario correctly that you want to create a measure and show with card visual.

Do you create the slicer with  MD_Sites[Site_Name] ?

Will you select the single item in the slicer or mutiple items in the slicer?

If it is convenient, could you share some data sample with table foramt which could reproduce your scenario so that we could copy and have a test on it?

Best  Regards,

Cherry

 

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

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors