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
Lars_Denmark
Frequent Visitor

Calculation of sale same period last year when no sale in selected period.

I have the following simple model:

Lars_Denmark_0-1685544472243.png

Lars_Denmark_1-1685545399815.png

I need to be able to create a measure that calculates lost sales to customers in a given period, where lost sales are defined as:

Situation where a customer has no positive sales in the selected period, and where sales in the same period last year are positive.

I would like to be able to insert the measure with the DAX calculation into the matrix and display a lost sale per customer and total for the customers shown.

In the example shown, a lost sale of 100 for customer Cust.6 and Cust.8 and a total of 200 should be shown.

I have now been trying to make a calculation for a long time, and I therefore now want to ask if there is a quick expert here who can help me.

1 REPLY 1
v-shex-msft
Community Support
Community Support

Hi @Lars_Denmark ,

Can you please share a pbix or some dummy data that keep the raw data structure with expected results? It should help us clarify your scenario and test to coding formula.

How to Get Your Question Answered Quickly  

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help 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.

Top Solution Authors