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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.