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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
dinovic
Frequent Visitor

Target calculation across two tables. Revenue cumulative daily. Target revenue Monthly

Table1. Cumulative Daily Revenue figures per Product

Product / revenue / date

Bike / 500 / 2017-01-01
Bike / 1000 / 2017-01-02
Car / 2000 / 2017-01-01
Car / 7000 / 2017-01-02

Table2. Monthly Revenue target per Product

Product / Revenue Target / Date (target)
Bike / 50000 / 2017-01-31
Car / 200000 / 2017-01-31

So, I would like to create a measure that calculates whether the Revenue from a particular product is on target, or not. The target would be calculated linearly, i.e. the revenue target for product Bike on the second of January would be 50000/31*2 = 3225.8. From Table1. we get the revenue on the 2nd of Januar was 1000, or only 31% of the targeted revenue that day.

How would you create this cross table calculation and/or the relationship between table 1 and 2, so it works for a selecter that selects based on product from table 1.

Thanks

 

1 ACCEPTED SOLUTION
v-sihou-msft
Microsoft Employee
Microsoft Employee

@dinovic

 

In this scenario, you can need to add a column to show number of days in corresponding month. Then use this column calculate the cumulative target in your Revenue Table.

 

1. Add a NumberOfDays column in your target table.

 

NumberOfDays = DAY(ENDOFMONTH(Target[Date]))

 

7.PNG

 

2. Then you can add a cumulative target column in your Revenue table

 

Cumulative Target = (RELATED(Target[RevenueTarget])/RELATED(Target[NumberOfDays])*DAY(Revenue[Date]))

88.PNG

 

 

Regards,

View solution in original post

2 REPLIES 2
v-sihou-msft
Microsoft Employee
Microsoft Employee

@dinovic

 

In this scenario, you can need to add a column to show number of days in corresponding month. Then use this column calculate the cumulative target in your Revenue Table.

 

1. Add a NumberOfDays column in your target table.

 

NumberOfDays = DAY(ENDOFMONTH(Target[Date]))

 

7.PNG

 

2. Then you can add a cumulative target column in your Revenue table

 

Cumulative Target = (RELATED(Target[RevenueTarget])/RELATED(Target[NumberOfDays])*DAY(Revenue[Date]))

88.PNG

 

 

Regards,

MFelix
Super User
Super User

Hi @dinovic,

 

checks this post I believe it's similar to what you want.

 

https://community.powerbi.com/t5/Desktop/Cumulative-Sales-vs-Sales-Forecast-in-current-Month/m-p/160...

 

Any question please feel free to ask.

 

Regards,

Mfelix

 

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



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!

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

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