Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hello everyone! I need some help, colleagues.
I have a fact table showing the quantity by segment and duration of employee tenure, and there is a reference table with norms based on the segment and duration of employee tenure.
How can I use DAX to fetch the value and correctly distribute the quantity range that meets the norms, and calculate the Percentage of Norm Completion based on the segment and duration of employee tenure? There is no direct relationship - I created an index column for the segment. The norm values are different for each segment.
I am attaching screenshots of the tables for better understanding.
need result an screenshot :
Solved! Go to Solution.
Hi @user_1111 ,
I suggest you to transform your tables first as below.
New Table:
Measure:
Range =
VAR _PART1 =
CALCULATE (
MAX ( 'Table'[Norm] ),
FILTER (
ALL ( 'Table' ),
'Table'[Segment] = MAX ( 'Table (2)'[Segment] )
&& 'Table'[Tenure] = MAX ( 'Table (2)'[Tenure] )
&& 'Table'[Norm] <= MAX ( 'Table (2)'[Norm] )
)
)
VAR _VALUE1 =
CALCULATE (
SUM ( 'Table'[Percentage] ),
FILTER (
ALL ( 'Table' ),
'Table'[Segment] = MAX ( 'Table (2)'[Segment] )
&& 'Table'[Tenure] = MAX ( 'Table (2)'[Tenure] )
&& 'Table'[Norm] = _PART1
)
)
VAR _PART2 =
CALCULATE (
MAX ( 'Table'[Percentage] ),
FILTER (
ALL ( 'Table' ),
'Table'[Segment] = MAX ( 'Table (2)'[Segment] )
&& 'Table'[Tenure] = MAX ( 'Table (2)'[Tenure] )
&& 'Table'[Norm] > MAX ( 'Table (2)'[Norm] )
)
)
RETURN
IF ( _PART1 = BLANK (), _PART2, _VALUE1 )
Result is as below.
You can download my attatchment to learn more details.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @user_1111 ,
I suggest you to transform your tables first as below.
New Table:
Measure:
Range =
VAR _PART1 =
CALCULATE (
MAX ( 'Table'[Norm] ),
FILTER (
ALL ( 'Table' ),
'Table'[Segment] = MAX ( 'Table (2)'[Segment] )
&& 'Table'[Tenure] = MAX ( 'Table (2)'[Tenure] )
&& 'Table'[Norm] <= MAX ( 'Table (2)'[Norm] )
)
)
VAR _VALUE1 =
CALCULATE (
SUM ( 'Table'[Percentage] ),
FILTER (
ALL ( 'Table' ),
'Table'[Segment] = MAX ( 'Table (2)'[Segment] )
&& 'Table'[Tenure] = MAX ( 'Table (2)'[Tenure] )
&& 'Table'[Norm] = _PART1
)
)
VAR _PART2 =
CALCULATE (
MAX ( 'Table'[Percentage] ),
FILTER (
ALL ( 'Table' ),
'Table'[Segment] = MAX ( 'Table (2)'[Segment] )
&& 'Table'[Tenure] = MAX ( 'Table (2)'[Tenure] )
&& 'Table'[Norm] > MAX ( 'Table (2)'[Norm] )
)
)
RETURN
IF ( _PART1 = BLANK (), _PART2, _VALUE1 )
Result is as below.
You can download my attatchment to learn more details.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
19 | |
14 | |
14 | |
11 | |
8 |