Forum Discussion
Accessible Reporting - Convert Matrix to Table, using Calculation Groups?
- 1 year ago
Hi Anonymous ,
You are absolutely right to look for a more accessible alternative - however, DAX does not support dynamic column names in a calculated table. This means we can't label columns like "July", "August", etc. based on date logic.
Instead, the best approach is to return rows with dynamic month labels and use a table visual, which is screen reader friendly.
Here’s a simplified calculated table that does this:
FlattenedClientReach =
VAR MaxMonthID = MAX('01b: Calendar'[Month Year ID])
RETURN
SELECTCOLUMNS(
ADDCOLUMNS(
GENERATE(
'AT - CLIENT REACH',
VAR Client = 'AT - CLIENT REACH'[Client ID]
RETURN
FILTER(
ADDCOLUMNS(
'01b: Calendar',
"ReachValue",
CALCULATE(
'AT - CLIENT REACH'[Measures - Client Reach],
'AT - CLIENT REACH'[Client ID] = Client
)
),
'01b: Calendar'[Month Year ID] > MaxMonthID - 12 &&
'01b: Calendar'[Month Year ID] <= MaxMonthID
)
),
"MonthName", FORMAT('01b: Calendar'[Date], "MMM YYYY")
),
"Client", [Client ID],
"Month", [MonthName],
"ClientReach", [ReachValue]
)If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it!
Thank you.
Hi Anonymous ,
To show the column names as "May 2024", "Apr 2024", etc. instead of just MM/YY codes, you can create a new column in your Date table that formats the date.
1.Go to your Date table
2.Add a new column with this formula:
MonthYearText = FORMAT('Date'[Date], "MMM YYYY")
This will turn dates into labels like:
01/05/2024 - "May 2024"
01/04/2024 - "Apr 2024"
Now just use this MonthYearText field:
As your column headers in a matrix
Or as labels in a calculated table or measure
If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it!
- Anonymous1 year agoNot applicable
Hi v-venuppu ,
I'm not quite following this. I'm trying to avoid using the matrix visual for accessibility reasons - the table visual allows screenreaders to ready out the information more effectively for blind and low-vision users.
Here's the DAX for my calculated table:
Flattened Client Reach = VAR MaxMonthID = MAX('01b: Calendar'[Month Year ID]) + 1 RETURN ADDCOLUMNS('AT - CLIENT REACH', "July", CALCULATE('AT - CLIENT REACH'[Measures - Client Reach], '01b: Calendar'[Month Year ID] = MaxMonthID - 11), "August", CALCULATE('AT - CLIENT REACH'[Measures - Client Reach], '01b: Calendar'[Month Year ID] = MaxMonthID - 10), "September", CALCULATE('AT - CLIENT REACH'[Measures - Client Reach], '01b: Calendar'[Month Year ID] = MaxMonthID - 9), "October", CALCULATE('AT - CLIENT REACH'[Measures - Client Reach], '01b: Calendar'[Month Year ID] = MaxMonthID - 8), "November", CALCULATE('AT - CLIENT REACH'[Measures - Client Reach], '01b: Calendar'[Month Year ID] = MaxMonthID - 7), "December", CALCULATE('AT - CLIENT REACH'[Measures - Client Reach], '01b: Calendar'[Month Year ID] = MaxMonthID - 6), "January", CALCULATE('AT - CLIENT REACH'[Measures - Client Reach], '01b: Calendar'[Month Year ID] = MaxMonthID - 5), "February", CALCULATE('AT - CLIENT REACH'[Measures - Client Reach], '01b: Calendar'[Month Year ID] = MaxMonthID - 4), "March", CALCULATE('AT - CLIENT REACH'[Measures - Client Reach], '01b: Calendar'[Month Year ID] = MaxMonthID - 3), "April", CALCULATE('AT - CLIENT REACH'[Measures - Client Reach], '01b: Calendar'[Month Year ID] = MaxMonthID - 2), "May", CALCULATE('AT - CLIENT REACH'[Measures - Client Reach], '01b: Calendar'[Month Year ID] = MaxMonthID - 1), "June", CALCULATE('AT - CLIENT REACH'[Measures - Client Reach], '01b: Calendar'[Month Year ID] = MaxMonthID))How can I change the "July" name to be dynamic, so it will show the MM/YY name from my date table that relates to MaxMonthID - 11?