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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
mrslyfox
Helper II
Helper II

Target Value KPI Targets

Hello,

Have a raw based table with target values for each month. Each raw has a link date for the first date of month. 
My KPI should calculated for previous day of month and compared with target value.
At the moment indicator showing only target value for one first day of month.

Any ideas how to deal with a trouble?

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @mrslyfox,

Did you try to make the calculation to the first date of the month instead of previous day?

I have a simolar setup and transform all the daily information to the same date that compares to the one in the target table.

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



View solution in original post

8 REPLIES 8
Anonymous
Not applicable

Hi @mrslyfox,

 

Can you share some sample file to test?

 

In addition, you can also try to use belwo formula if it suitable for your requirement:

 

Measure: Calculate the previous month average as target and show it at the first date of each month.

 

Target=
var currDate=Max(D_Date[DATE_Date])
var minDate=MINX(Filter(ALL(F_Invoice),Month(F_Invoice[Date])=Month(CurrDate)&&F_Invoice[Date]<=CurrDate),[Date])
var perviousTarget=AVERAGEX(Filter(ALL(F_Inventory),[Date]>=Date(Year(currDate),Month(currDate)-1,1)&&[Date]<=Date(Year(currDate),Month(currDate),1-1)),[M2])
return
IF(MAX(F_Invoice[Date])=minDate,perviousTarget,blank())

 

 

Regards,

Xiaoxin Sheng

Hello,

Targets comes from SQL table as is.

One month = one raw devided by columns with different goals values.

Link date field looks like dd-mm-yyyy where day always equal to firtst day of the month.

 

My KPI is calsulated per day of month.

It mean I need some how to say that IF KPI is calculated for current date, the target value should be picked up for the first date of month or just like a sum for current month (because only one target record exist).

Why the KPI goal target value is not calculated in the same way as

the same formula showing right result for Card visual..

 

DSI.png

MFelix
Super User
Super User

Hi @mrslyfox,

Did you try to make the calculation to the first date of the month instead of previous day?

I have a simolar setup and transform all the daily information to the same date that compares to the one in the target table.

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



Hi,
Measure used for different indicators and tables at the same repot page.

I do not see it possible at the moment.

I can't help you without further information can you please show some data or the way you calculate the Measure?


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



Measure:= SUMX(RELATEDTABLE(F_Inventory),F_Inventory[M2])
/
(CALCULATE(
                        IF(
                            COUNT(D_Date[DATE_Date])>=30,
                            SUM(F_Invoice[M2])
                           ),
                        FILTER(
                                    ALL(D_Date),
                                    D_Date[DATE_Date]>(MAX(D_Date[DATE_Date])-30)
                                          && D_Date[DATE_Date]<=MAX(D_Date[DATE_Date])
                            )
)/30)

With only the formula of this meaasure and not knowing what each value represents I can't do a lot but I notice that in the IF you do a Count of the DATE why are you using a count and not the actual date itself?


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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.