cancel
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.

Reply
AnupaJ
Frequent Visitor

Create a measure to calculate a value difference between the latest and the earliest date

I want to create a measure to find the sum of the below between the latest date and the earliest date. 
I have a column for the date in the table

measure= qty * price

1 REPLY 1
Sahir_Maharaj
Super User
Super User

Hello @AnupaJ,

 

You can use the following DAX formula:

TotalAmount =
CALCULATE(
    SUMX(
        TableName,
        TableName[qty] * TableName[price]
    ),
    FILTER(
        TableName,
        TableName[date] = MAX(TableName[date])
            || TableName[date] = MIN(TableName[date])
    )
)

Should you require further details or assistance please do not hesitate to reach out to me.


Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Sahir Maharaj
P.S. Want me to build your Power BI solution?
Data Scientist | Data Engineer | Data Analyst | AI Engineer

➤ Website: https://sahirmaharaj.com

➤ Email: sahir@sahirmaharaj.com

➤ Lets connect on LinkedIn: Join my network of 12K+ professionals

➤ Want me to build your Power BI solution? Lets chat about how I can assist!

➤ Join my Medium community of 30k readers! Sharing my knowledge about data science and artificial intelligence


LinkedIn Top Voice in Artificial Intelligece, Data Science and Machine Learning

Helpful resources

Announcements
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