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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
changhong
Frequent Visitor

Sparkline in Table Visual

Hi,

 

I am trying to build the table below in Power BI but having issue to show the sparkline for different items and x-axis for 5 quarters(based on the selected quarter slicer).

changhong_0-1720109003252.png

I have tried to used an independent date table and calculation group, but still unable show the sparkline.

changhong_1-1720109163071.png

Attached the sample.pbix , please enlighten me on this.

9 REPLIES 9
Ashish_Mathur
Super User
Super User

Hi,

The problem is not 'building the sparkline" - that is a simple line chart.  Perhaps the challenge is going back 4 quarters from the choen quarter.  I have solved a similar question in the attached files.  Please study my solution there and adapt it to your data.

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi @Ashish_Mathur ,

 

In the sample pbix file provided, I had the similar implementation but it couldnt work in the table with multiple row items that get populated with switch statement.

 

Here is my calculation group "Prev 5 Quarters". 

changhong_0-1720162014975.png

It works with line chart. 

changhong_1-1720162111621.png

But it does not works with the table visual. 

 

Best regards,

Chang Hong

As you can see in my file, it works fine even if you switch to a Table visual.  Please review my solution again.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi Ashish,

 

I have followed your solution but the table visual still not working as expected. Can you please review my file? 

 

sample v2.pbix 

 

changhong_0-1720682072523.png

 

Best regards,

Chang Hong

 

I would not want to review your file.  Maybe someone else can help you.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-heq-msft
Community Support
Community Support

Hi @changhong ,
According to your description, you can't create a sparkline based on a quarter. you can refer to the following documentation to learn how to create a sparkline in power bi. please note the limitations of these operations.
Sparkline in Power BI - RADACAD
Create sparklines in a table or matrix in a report (preview) - Power BI | Microsoft Learn
Solved: Sparkline Visual - Microsoft Fabric Community

Best regards,
Albert He

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

Hi @v-heq-msft ,

 

From the first link you provided, below is the statement from the article
"If you have a custom Date table created by Power Query or DAX or any other way, you can use fields such as Year-Month combination, or Year-Quarter combination, or just Year to have fewer data points in the sparkline."

 

Best regards,

CH

changhong
Frequent Visitor

Hi @NaveenGandhi ,

 

I have provided the access.

Attached the same file in dropbox sample.pbix 

 

Regards,

CH

NaveenGandhi
Super User
Super User

Hi @changhong 

Please provide access to the PBIX so that i can have a look.


Thanks,
NG

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! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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