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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
PaulDBrown
Community Champion
Community Champion

KPI Visual: empty "Goal" and "+Infinity%"?

Good Afternoon,

 

There must be an obvious reason but I cannot fathom it out. I am trying to include a KPI visual which compares YTD sales figures with Previous YTD sales, but I get and empty comparison.

Here is the screenshot:

 

KPI Visual.PNG

The two boxes underneath are the measure reflecting both current and previous year YTD sales numbers.

The trend axis is "year".

 

Any pointers??

 

Thank you very much for your help!

 

regards

Paul.





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






1 ACCEPTED SOLUTION

@PaulDBrown

Thanks for sharing the pbix. Add ALL to the filter to exclude any filter context.

 

Sales YTD = calculate(sum('Campañas2'[Facturación Real]),
	Filter(ALL(YearMonth),
	YearMonth[month]<= MONTH(TODAY())
	&&
	YearMonth[year]=YEAR(TODAY())
	))

Sales MonthTD Previous Year = calculate(sum('Campañas2'[Facturación Real]),
	Filter(ALL(YearMonth),
	YearMonth[month]= MONTH(TODAY())
	&&
	YearMonth[year]=YEAR(TODAY())-1
	))

Capture.PNG

 

 

View solution in original post

6 REPLIES 6
Eric_Zhang
Employee
Employee

@PaulDBrown

 

What are those two measure DAX formula? Could you share a sample pbix file?

@Eric_Zhang

 

Sure I can share a sample pbix file? How do I share it though??





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






@PaulDBrown

You can upload a pbix file to Onedrive or any web storage and share the link. Do mask sensitive data before uploading.

@Eric_Zhang

 

Here it is:

 

KPI test File





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






@PaulDBrown

Thanks for sharing the pbix. Add ALL to the filter to exclude any filter context.

 

Sales YTD = calculate(sum('Campañas2'[Facturación Real]),
	Filter(ALL(YearMonth),
	YearMonth[month]<= MONTH(TODAY())
	&&
	YearMonth[year]=YEAR(TODAY())
	))

Sales MonthTD Previous Year = calculate(sum('Campañas2'[Facturación Real]),
	Filter(ALL(YearMonth),
	YearMonth[month]= MONTH(TODAY())
	&&
	YearMonth[year]=YEAR(TODAY())-1
	))

Capture.PNG

 

 

@Eric_Zhang

Thanks you!!!

 

You're an absolute star!

 

(I only wish I understood why addin "ALL" is necessary though...)

 

Best regards,

 

Paul.





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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