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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Display total count in Power BI line chart

Hi,

 

How to display total count value in end of the line chart. In below line chart I have count for 6-3447,12-443,18-1187,24-396.

 

For Example, 3447+443+1187+396 = 5473

 

Screenshot_5.png

 

Regards,

Yuvaraj

1 ACCEPTED SOLUTION

I think I got it figured out. My results won't match your data set because I had to recreate the sample data. It wouldn't let me copy and paste it from your doc because the size was too large. No worries though, I think I found a solution for you. First create a column as follows (you can add as many groups as you like, I only went to the last 24 months): 

6 Month Increments = 
VAR _DateDiff = 
    DATEDIFF(TODAY(),Sheet1[ModifiedDate],DAY)

RETURN
SWITCH(
    TRUE(),
    _DateDiff > (-180), "1. Last 6 Months",
    _DateDiff > (-360), "2. Last 12 Months",
    _DateDiff > (-540), "3. Last 18 Months",
    _DateDiff > (-720), "4. Last 24 Months",
    "5. Older"
)

Then create either use the quick measure creation tool I showed before, or just write one that mirrors the following: 

Count of CommunityID running total in 6 Month Increments = 
CALCULATE(
	COUNTA('Sheet1'[CommunityID]),
	FILTER(
		ALLSELECTED('Sheet1'[6 Month Increments]),
		ISONORAFTER('Sheet1'[6 Month Increments], MAX('Sheet1'[6 Month Increments]), DESC)
	)
)

This will give you the following result when you put them in your chart: 

Capture3.PNGHere is a PBIX with the solution in it as well in case it helps. 

View solution in original post

13 REPLIES 13
jtownsend21
Responsive Resident
Responsive Resident

I think you should be able to use the running total quick measure. 

 

parry2k
Super User
Super User

@Anonymous does something liek this will work

 

image.png



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

Hi parry2k

 

Thanks for your response.

 

Am expecting similar to this, could you please provide the steps to acheive this.

 

Regards,

Yuvaraj

@Anonymous Not sure who you are addressing, but here are the steps to create a quick measure. c711ffc1-9f5e-48af-a959-2247eede6a15.gif

 

Your base value would be your count, and your Field would be whatever field you have on the x-axis. 

@Anonymous solution is attached.solution is attached.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

Hi,

In below line chart, i have to show the running total count. For example, in 6 month the count is 2369 so while show the count for 12 month it should be add the 6 month count total as well. Simillarly for 18,24 month.

Screenshot_7.png

Expected result:

for 6 -2369

     12 - 2369+377 = 2746

     18 - 2746+810 = 3556

     24 - 3556+211 = 3767

Finally it should show the total as 3767.

 

Regards,

Yuvaraj

@Anonymous Can you share some sample data or your PBIX? 

 

How are you calculating "Timeline"? Is that a field in your data? 

 

I am still fairly certain the running total quick measure should work for you. If you can share sample data or PBIX I would be happy to play with it and see if I can get something working for you. 

Anonymous
Not applicable

Hi,

 

Thanks for your reply.

Here I have attched the source data, I need the Community count for last 6Month,12Month...,24Month afterwards finally i have to show total count.

 

I have created the column as Month category its have values as 6,12,18,24.

MonthCategory = VAR six =1.* (max(tbl_OverallInventoryDetails[ModifiedDate])-tbl_OverallInventoryDetails[6Month])

VAR twelve =1.* (max(tbl_OverallInventoryDetails[ModifiedDate])-tbl_OverallInventoryDetails[12Month])
VAR eighteen =1.* (max(tbl_OverallInventoryDetails[ModifiedDate])-tbl_OverallInventoryDetails[18Month])
VAR twentyfour =1.* (max(tbl_OverallInventoryDetails[ModifiedDate])-tbl_OverallInventoryDetails[24Month])

RETURN

if(MAX(tbl_OverallInventoryDetails[ModifiedDate]) - tbl_OverallInventoryDetails[ModifiedDate] <six,6,
if(MAX(tbl_OverallInventoryDetails[ModifiedDate]) - tbl_OverallInventoryDetails[ModifiedDate] <twelve,12,
if(MAX(tbl_OverallInventoryDetails[ModifiedDate]) - tbl_OverallInventoryDetails[ModifiedDate] <eighteen,18,
if(MAX(tbl_OverallInventoryDetails[ModifiedDate]) - tbl_OverallInventoryDetails[ModifiedDate] <twentyfour,24
))))

 

In above line chart i got count for month wise but am expecting to get the running total.

https://avacorp1-my.sharepoint.com/:x:/g/personal/yuvaraj_g_avasoft_com/EcTJQbXlzftCmhQfgINmWSgBG85v...

 

Regards,

Yuvaraj

I think I got it figured out. My results won't match your data set because I had to recreate the sample data. It wouldn't let me copy and paste it from your doc because the size was too large. No worries though, I think I found a solution for you. First create a column as follows (you can add as many groups as you like, I only went to the last 24 months): 

6 Month Increments = 
VAR _DateDiff = 
    DATEDIFF(TODAY(),Sheet1[ModifiedDate],DAY)

RETURN
SWITCH(
    TRUE(),
    _DateDiff > (-180), "1. Last 6 Months",
    _DateDiff > (-360), "2. Last 12 Months",
    _DateDiff > (-540), "3. Last 18 Months",
    _DateDiff > (-720), "4. Last 24 Months",
    "5. Older"
)

Then create either use the quick measure creation tool I showed before, or just write one that mirrors the following: 

Count of CommunityID running total in 6 Month Increments = 
CALCULATE(
	COUNTA('Sheet1'[CommunityID]),
	FILTER(
		ALLSELECTED('Sheet1'[6 Month Increments]),
		ISONORAFTER('Sheet1'[6 Month Increments], MAX('Sheet1'[6 Month Increments]), DESC)
	)
)

This will give you the following result when you put them in your chart: 

Capture3.PNGHere is a PBIX with the solution in it as well in case it helps. 

Anonymous
Not applicable

Hi jtownsend21,

Thanks for your reply. We almost near to this i need one thing, is that possibile to show the total count as Full Inventory.

The Full Inventory Contains the total count (6+12+18+24 months) 

 

Regards,

Yuvaraj

The item showing "last 24 months" in my graph would have the number you are asking for.

 

Do you mean that you need it to show the labels?  

Anonymous
Not applicable

Yes am expecting that one.

jthomson
Solution Sage
Solution Sage

Would have thought you could have just added a card visual and stuck in whatever measure you've put in as the values on the line chart?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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