The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hi
I am trying to create a column in my table called "Value"that looks at the number in the Actual Duration column and inputs a value based on the table below. Please can someone help me with the the DAX coding to get his result.
Many thanks
Actual Duration | Value |
0-15 | 15 |
16-20 | 20 |
21-30 | 30 |
Solved! Go to Solution.
Hi, @spandy34
Please try following steps:
1.add calculated columns "Start",'End' as below:
Start = LEFT('Table'[Actual Duration], search("-",'Table'[Actual Duration])-1)
End = RIGHT('Table'[Actual Duration],len('Table'[Actual Duration])-search("-",'Table'[Actual Duration]))
2.Add a measure like:
Result =
CALCULATE (
MAX ( 'Table'[Value] ),
FILTER (
'Table',
'Table'[Start] <= MAX ( 'Fact Table'[Actual Duration] )
&& 'Table'[End] >= MAX ( 'Fact Table'[Actual Duration] )
)
)
Best Regards,
Community Support Team _ Eason
Hi
I am trying to create a column in my table called "Value"that looks at the number in the Actual Duration column and inputs a value based on the table below. Please can someone help me with the the DAX coding to get his result.
Many thanks
Actual Duration | Value |
0-15 | 15 |
16-20 | 20 |
21-30 | 30 |
Hi, @spandy34
Please try following steps:
1.add calculated columns "Start",'End' as below:
Start = LEFT('Table'[Actual Duration], search("-",'Table'[Actual Duration])-1)
End = RIGHT('Table'[Actual Duration],len('Table'[Actual Duration])-search("-",'Table'[Actual Duration]))
2.Add a measure like:
Result =
CALCULATE (
MAX ( 'Table'[Value] ),
FILTER (
'Table',
'Table'[Start] <= MAX ( 'Fact Table'[Actual Duration] )
&& 'Table'[End] >= MAX ( 'Fact Table'[Actual Duration] )
)
)
Best Regards,
Community Support Team _ Eason
User | Count |
---|---|
14 | |
11 | |
6 | |
6 | |
5 |
User | Count |
---|---|
28 | |
17 | |
12 | |
7 | |
5 |