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

Bar Chart Summing Legend With Slicer Change Over Time. HELP!

Hello All, 

 

I am driving myself stark raving mad trying to create a basic bar chart in Power BI. I am using Google Analytics data, which has unique users and sessionids along with a disengaged variable if a user doesn't return in a specific number of days. I am attempting to create a bar chart that is able to show the distinct number of users (y-axis) over a set of 6 categories (x-axis), colored by the max number of disengagements.

 

Here is the hard part: I want to include a slicer which shows the amount of time since the first visit. Thus, the user will be able to slide the slider and see how the number of disengagements changes over the number of days since their first visit to the site. However, as the number of distinct users has not changed (nor their category) the bars values should remain the same. The issue I keep running into is that the legend option for the bar chart automatically sums by each distinct user and then their associated legend value. This causes double counting as a user is being tallyed for not being disengaged, then again for the second and third and so forth. 

I have also run into the issue where the only ways I have have found to calcuate a max value per userid is static and thus would not work with the dynamic slider as you change the time. How can you prevent the table being shown from double counting!?!? 

 

Please save me. My head hurts! 

2 REPLIES 2
V-pazhen-msft
Community Support
Community Support

@WolVecz 
It is difficult to figure out your question from just work description.

Please see how to raise a post to get your answered quickly:

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 

Regards
Paul

No need to be so condisending. Unfortunitly, I am unable to upload images due to the image feature on this site and I didn't anticipate double counting to be overly complicated. If there is confusion around the term double counting then I can explain like this: 

 

userID  SessionId   Disengaged

1               1                   0        

1               2                   1

2               1                   0

3               1                   0

1               3                   2

 

If DISTINCTCOUNT is used on userID then userID 1 should only occur once, not thrice like above. The bar chart does work properly without the legend (showing userId 1 once), but once disengaged is put on the legend of a bar chart, the bar chart shows values for all of the above, thus UserID 1 gets counted 3 times, which changes the y axis on the bar chart (counting user more than once or "double counting"). As the number of users has not changed, this is bad. Thus, I need to create a flag which manually flags the row with the highest value of disengage and filters on the flagged field, such that it only shows the value with userID 1 and disengaged 3. However, every method that I have found online will only generate a flag statically, meaning it would not work with a slicer, which could limits the data over a specific time range (so the slicer may remove userID 1 and disengaged 3, as a result the desired output would be userID 1 and disenaged 2). As I want to use a slicer, the flag must be dynamically set. Thus I am looking for a way to ensure that userID1 with disengaged 3 is the only value showed if the slicer is within the above range. 

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.