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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register 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
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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

Top Solution Authors