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.
Hi there,
I am trying to calculate a trend between two columns of text that I have coded for hierarchical responses. This code works for telling it to not calculate a trend when one of my fields is blank:
TREND_SIGN = IF(NOT(ISBLANK('Threats'[TREND_code])),SIGN(LOOKUPVALUE('Threats'[TREND.CODE in Power BI],'Threats'[SOPParkID],[SOPParkID],
'Threats'[EvaluationPeriod],[EvaluationPeriod]-3-INT(([EvaluationPeriod]-2010)/6),
'Threats'[Response title reporting],[Response title reporting],'Threats'[KeyColumnValue],
[KeyColumnValue],0)-[TREND.CODE in Power BI]))
I now need to add in here another code to tell it if [previous evaluation] = blank, then don't calculate a trend?
Is this possible?
I should have put a list of what hasn't worked here... Neither of these worked:
1//
IF(NOT(ISBLANK('Threats'[TREND_code]))
|| NOT ( ISBLANK('Threats'[PREVIOUS_RESPONSE])),SIGN(LOOKUPVALUE('Threats'[TREND.CODE in Power BI],'Threats'[SOPParkID],[SOPParkID],
'Threats'[EvaluationPeriod],[EvaluationPeriod]-3-INT(([EvaluationPeriod]-2010)/6),
'Threats'[Response title reporting],[Response title reporting],'Threats'[KeyColumnValue],
[KeyColumnValue],0)-[TREND.CODE in Power BI]))
2//
TREND_SIGN = IF(NOT(ISBLANK('Threats'[TREND_code]))
&& NOT ( ISBLANK([PREVIOUS_RESPONSE])),SIGN(LOOKUPVALUE('Threats'[TREND.CODE in Power BI],'Threats'[SOPParkID],[SOPParkID],
'Threats'[EvaluationPeriod],[EvaluationPeriod]-3-INT(([EvaluationPeriod]-2010)/6),
'Threats'[Response title reporting],[Response title reporting],'Threats'[KeyColumnValue],
[KeyColumnValue],0)-[TREND.CODE in Power BI]))
Hi,
I am not sure how your datamodel looks like, but please try using && DAX function or || DAX function.
It represents AND or OR. Please check the link down below.
And, please try the below measure whether it suits your requirement.
TREND_SIGN =
IF (
NOT ( ISBLANK ( 'Threats'[TREND_code] ) )
&& NOT ( ISBLANK ( [previous evaluation] ) ),
SIGN (
LOOKUPVALUE (
'Threats'[TREND.CODE in Power BI],
'Threats'[SOPParkID], [SOPParkID],
'Threats'[EvaluationPeriod],
[EvaluationPeriod] - 3
- INT ( ( [EvaluationPeriod] - 2010 ) / 6 ),
'Threats'[Response title reporting], [Response title reporting],
'Threats'[KeyColumnValue], [KeyColumnValue],
0
) - [TREND.CODE in Power BI]
)
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
User | Count |
---|---|
84 | |
80 | |
72 | |
71 | |
55 |
User | Count |
---|---|
108 | |
106 | |
93 | |
85 | |
67 |