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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
kabra_ashish
Helper III
Helper III

KPI Visual

I have a Data table and a fact table.

 

Date table - It has all the dates starting 01-Jan-2019 until 31-Dec 2020.

Custom created few more fields like Year, Month and "Month & Year".

 

Fact table - It has the dates (which is joined with the date table) and a column which has the amount spent.

 

A slicer is created using the "Month & Year" field from the date table.

 

I want to show the selected period (slicer) total spend as well as the total spend for the same period last year and the difference. So I chose KPI visual to showcase the same.

 

Current_Spend = Calculate(Sum('Table'[amount]))

The result pulled is only for the last day when using above formula. Example: When I select November 2020 it gives data for November 30 2020 only.

 

This problem was resolved by using ALL function as below:

Current_Spend = Calculate(Sum('Table'[amount]),All("Date_field")

 

However I am unable to pull off the Goal which should be complete November 2019 to do the comparison. It shows only last day of November 2019 i.e, 30-November-2019.

 

Any help here will be highly appreciated!

1 ACCEPTED SOLUTION
v-janeyg-msft
Community Support
Community Support

Hi,@kabra_ashish 

 

According to your description, I tested it, I think you need to put the field of the slicer on KPI 'trend axis', for example, ‘month&year’.

Like this:

1.png

Here is my sample .pbix file.Hope it helps.

If it doesn’t solve your problem, please feel free to ask me.

 

Best Regards

Janey Guo

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-janeyg-msft
Community Support
Community Support

Hi,@kabra_ashish 

 

According to your description, I tested it, I think you need to put the field of the slicer on KPI 'trend axis', for example, ‘month&year’.

Like this:

1.png

Here is my sample .pbix file.Hope it helps.

If it doesn’t solve your problem, please feel free to ask me.

 

Best Regards

Janey Guo

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@kabra_ashish , I think you should use time intelligence for that , with help from date table

example

MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))

last year MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-12,MONTH)))

 

With one date if should be able you give you

 

Power BI — Month on Month with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-mtd-questions-time-intelligence-3-5-64b0b4a4090e
https://www.youtube.com/watch?v=6LUBbvcxtKA

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors