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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Anonymous
Not applicable

Display Last Month Sales in KPI box

hi all,

 

I am looking for 3 simple calculations including instructions on how to display them in a KPI box.

 

1. Last month revenue

2. Avg. last 3 months revenue

3. Avg. launch-to-date revenue

 

So far i have made these calculations (see image).

How can i display 243,02 in the KPI box, which is the last month from current period? right now it is just accumulating all the values in the box.

 

also, if anyone know how to hide actuals on the graph after last rev. available data, so it does not go constant from latest period until end of year. The budget should of course remain.

 

cap8.PNG

 

 

 

3 REPLIES 3
v-frfei-msft
Community Support
Community Support

Hi @Anonymous,

 

I made one sample here for your reference. We can create the mesaures as below to meet your requirement.

 

Last month revenue = IF(MONTH(MAX(Table1[date]))<>12,CALCULATE(SUM(Table1[sales]),FILTER(ALL(Table1),YEAR(Table1[date])*100+MONTH(Table1[date]) = YEAR(MAX(Table1[date]))*100 +MONTH(MAX(Table1[date]))-1)),CALCULATE(SUM(Table1[sales]),FILTER(ALL(Table1),YEAR(Table1[date])*100+MONTH(Table1[date]) = YEAR(MAX(Table1[date])-1)*100 +01)))
Avg. last 3 months revenue = CALCULATE(SUM(Table1[sales]),DATESINPERIOD(Table1[date],LASTDATE(Table1[date]),-3,MONTH))/3
Avg. launch-to-date revenue = CALCULATE(SUM(Table1[sales]),ALL(Table1))/CALCULATE(DISTINCTCOUNT(Table1[yyyymm]),ALL(Table1))

Then we can get the result as we excepted.

 

Capture.PNG

 

For more details, please check the pbix as attached.

 

https://www.dropbox.com/s/3k9zlqncgahytp7/Display%20Last%20Month%20Sales%20in%20KPI%20box.pbix?dl=0

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Hi @Anonymous,

 

Does that make sense? If so, kindly mark my answer as a solution to close the case.

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
Anonymous
Not applicable

Hi @v-frfei-msft,

 

Thanks for your reply.

 

I have been trying to replicate your formula using my tables, unfortunately there is some syntax error.

 

Please see attached pictures.

 

I noticed a difference, I have repeating same dates and you only have 1 date per X amount of sale.

 

Could that cause the problems?

 

cap2.PNG

 

 

 

 

 

cap3.PNG

 

best regards

Helpful resources

Announcements
Fabcon_Europe_Social_Bogo

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.