Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
I have a calculated column in one one of my tables that looks at an individuals age and then assigns them into a specific age grouping. Very simple but I need to know based on the current company and date range selected on my report if any of the age groups will have less than a certain number of individuals, if they do then I need to broaden the age grouping. Not sure how to accomplish this in DAX. Here is the current code, any help is much appreciated. Thanks.
Solved! Go to Solution.
Hi @nhale777 ,
According to your description, I create a sample table:
You want to know if any of the age groups will have less than a certain number of individuals, here's my solution:
Create a group table containing all the groups.
Then create a column to calculate the number of individuals belonging to each group:
Column =
COUNTROWS (
FILTER (
'Table',
'Table'[Age]
>= LEFT (
[Group],
SEARCH ( "&", [Group],, SEARCH ( "-", [Group],, SEARCH ( "<", [Group],, 0 ) ) ) - 1
)
&& 'Table'[Age]
< RIGHT (
[Group],
LEN ( [Group] )
- SEARCH ( "&", [Group],, SEARCH ( "-", [Group],, SEARCH ( "<", [Group],, 0 ) ) )
)
)
)
Get the correct result:
I attach my sample below for your reference.
Best regards,
Community Support Team_yanjiang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @nhale777 ,
According to your description, I create a sample table:
You want to know if any of the age groups will have less than a certain number of individuals, here's my solution:
Create a group table containing all the groups.
Then create a column to calculate the number of individuals belonging to each group:
Column =
COUNTROWS (
FILTER (
'Table',
'Table'[Age]
>= LEFT (
[Group],
SEARCH ( "&", [Group],, SEARCH ( "-", [Group],, SEARCH ( "<", [Group],, 0 ) ) ) - 1
)
&& 'Table'[Age]
< RIGHT (
[Group],
LEN ( [Group] )
- SEARCH ( "&", [Group],, SEARCH ( "-", [Group],, SEARCH ( "<", [Group],, 0 ) ) )
)
)
)
Get the correct result:
I attach my sample below for your reference.
Best regards,
Community Support Team_yanjiang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Ask questions in Eventhouse and KQL, Eventstream, and Reflex.
User | Count |
---|---|
84 | |
82 | |
64 | |
62 | |
56 |
User | Count |
---|---|
171 | |
112 | |
110 | |
72 | |
72 |