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
JakeJack
Frequent Visitor

Issue with a KPI Visual

Afternoon all

 

I've an issue with a KPI Visual.

 

This visual shows the Fiscal YTD Sales with a the target as Previous Year Fiscal YTD Sales.  My Fiscal Year begins on 1st July.

 

The visual is working as expected for year ending 30th June past but I'm getting an error for this current fiscal year ie only data up to 6th July.

 

KPI_1.png

The measures I'm using are:

 

Value: 

FYTD Sales = CALCULATE([Total Sales],
DATESYTD(Dates[CurDate], "30/06" )
)
 
Trend Axis: FiscalPeriod.  This is a field in the calendar table, Dates
 
Target: 
PFYTD Sales =
VAR pyear = year([Max Date])-1
VAR pfiscalyear = max(Dates[FiscalYear])-1
VAR lmaxdate =
date(pyear,month([Max Date]),day([Max Date]))
Return
CALCULATE ( TOTALYTD([Total Sales],Dates[CurDate],"30/06")
          ,Dates[FiscalYear]=pfiscalyear
          ,Dates[CurDate]<=lmaxdate
           )
 
The measure [Max Date] is 
Max Date = max(Sales[DocDate])
 
Like I said above this KPI visual works when I select the previous fiscal year from a slicer.  The FiscalYear field is also in the calendar table:
 
KPI_2.png
 
The two measures are correctly calculating the values for the current fiscal year:
 
KPI_3.png
 
I believe the issue is the trend axis as when I remove it from the visual I no longer get an error but I get a blank visual:
 
KPI_4.png
 
So any thoughts why this isn't working for the current fiscal year?
 
Does the visual not work when there's no trend axis specified?
 
Many thanks
 
Jake
 
 
 
 

 

 

 

1 ACCEPTED SOLUTION
JakeJack
Frequent Visitor

Hi All

 

I believe I've resolved my issue.

 

In the trend axis when I use FiscalYear it works - not sure why though.  It works for previous fiscal year with FiscalPeriod as the trend axis value.

 

Cheers

 

Jake

View solution in original post

1 REPLY 1
JakeJack
Frequent Visitor

Hi All

 

I believe I've resolved my issue.

 

In the trend axis when I use FiscalYear it works - not sure why though.  It works for previous fiscal year with FiscalPeriod as the trend axis value.

 

Cheers

 

Jake

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.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

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