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
Anonymous
Not applicable

New Measure with filter by Date measure

Hi all,

 

I am a little bit stuck. Maybe its too easy for me to see. 

Following situation.

I created a "date of first sale" measure for my products.

Now i want to create a new measure which gives me the sales of all products that have a "date of first sale" less than 12 months ago.

Basically i am trying to develop a marketing KPI on how much % products which had their "date of first sale" in the last 12 months contributed to my total sales.

 

My idea was:

Inovoiced Sales - New products = CALCULATE(SalesInvoiceV2Lines[Invoiced sales];FILTER(SalesInvoiceV2Lines;[Date of first sale] >= (DATEADD(DateDimension[FullDateAlternateKey].[Date];-12;MONTH))))
 
I appreciate any input.
 
Thanks and BR,
Paul
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi,

 

I figured it out.

For me works. Dont know though if my approach is smooth though. 

 

Invoiced sales new products = CALCULATE(SalesInvoiceV2Lines[Invoiced sales]; DATESINPERIOD(ReleasedProductsV2[Date of first sale].[Date];DATE(YEAR(TODAY());MONTH(TODAY()); DAY(TODAY()));-1;YEAR))
 
Thanks and BR,
Paul

View solution in original post

2 REPLIES 2
v-yiruan-msft
Community Support
Community Support

Hi @Anonymous ,

Please try to create a measure as below:

Marketing KPI =
DIVIDE (
    CALCULATE (
        SUM ( SalesInvoiceV2Lines[Invoiced sales] ),
        SAMEPERIODLASTYEAR ( DateDimension[FullDateAlternateKey].[Date] )
    ),
    SUMX ( ALL ( SalesInvoiceV2Lines ), SalesInvoiceV2Lines[Invoiced sales] )
)

If the above measure is not applicable for your scenario, please provide some sample data in table SalesInvoiceV2Lines(exclude sensitive data) and the formula of your measure "date of first sale". Also please describe your expected result with screen shot. Thank you.

Best Regards

Rena

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

Hi,

 

I figured it out.

For me works. Dont know though if my approach is smooth though. 

 

Invoiced sales new products = CALCULATE(SalesInvoiceV2Lines[Invoiced sales]; DATESINPERIOD(ReleasedProductsV2[Date of first sale].[Date];DATE(YEAR(TODAY());MONTH(TODAY()); DAY(TODAY()));-1;YEAR))
 
Thanks and BR,
Paul

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.