Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Frequent Visitor

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

I have the following simple model:



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.

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  


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

PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors