- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
DAX for percent of stacked column (only column not GT) with date hierarchy
I have a stacked column chart with two categories in the series/legend (under 65 and over 65). It shows a count of people in each of the two series.
I also have a date heirarchy on the x axis.
I need the series to display data labels showing count AND percent of total for each column (not percent of grand total).
I have created a measure using DAX to calculate the percent of total and added this to the detail section of the data labels. This works well for a single stacked column, but when I add the date heirarchy it shows percent of grand total, not percent of each column.
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This solution assumes that your model has a date table (best practice). The concept is to keep the Month filter context while clearing all other filters originating within the visual.
Percent Stream2 =
DIVIDE (
DISTINCTCOUNT ( Table1[ID] ),
CALCULATE (
DISTINCTCOUNT ( Table1[ID] ),
ALLSELECTED (),
VALUES ( 'Date'[Month] )
)
)
Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This solution assumes that your model has a date table (best practice). The concept is to keep the Month filter context while clearing all other filters originating within the visual.
Percent Stream2 =
DIVIDE (
DISTINCTCOUNT ( Table1[ID] ),
CALCULATE (
DISTINCTCOUNT ( Table1[ID] ),
ALLSELECTED (),
VALUES ( 'Date'[Month] )
)
)
Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Helpful resources
Subject | Author | Posted | |
---|---|---|---|
11-15-2023 05:03 AM | |||
07-03-2024 12:12 AM | |||
08-08-2024 10:34 PM | |||
02-01-2024 06:02 PM | |||
07-01-2024 04:28 AM |
User | Count |
---|---|
19 | |
17 | |
14 | |
13 | |
11 |