The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
I have a measure which based upon a series of IF functions uses CONCATENATE to develop a text statement. It all works except for one IF statement that asks if a measure (SELECTEDCOMPANY[Revenue_LastDate_%ofPeers]) is greater than a second measure SELECTEDCOMPANY[Revenue_FirstDate_%ofPeers] to return some text if TRUE and a different text if FALSE. My prolem is sometimes the IF statement is returning TRUE when its actually FALSE and it appears random. Any ideas of why this could be happening?
I've copied the relevant part of my measure below:-
IF(SELECTEDCOMPANY[Revenue_LastDate_%ofPeers]>SELECTEDCOMPANY[Revenue_FirstDate_%ofPeers], " It's position strengthened relative to its peers " , " It's position weakened relative to its peers ")
Solved! Go to Solution.
I've solved the problem. The input measures for the IF statement were formatted as text rather than a number. By resolving this the IF statement is behaving normally.
Thanks.
I've solved the problem. The input measures for the IF statement were formatted as text rather than a number. By resolving this the IF statement is behaving normally.
Thanks.
Hi @AutyDA
Can you share the sample data ?? what is
SELECTEDCOMPANY[Revenue_LastDate_%ofPeers]
SELECTEDCOMPANY[Revenue_FirstDate_%ofPeers]
two columns presenting data..
SELECTEDCOMPANY[Revenue_LastDate_%ofPeers] and SELECTEDCOMPANY[Revenue_FirstDate_%ofPeers] are both measures in a table which is being filtered by various slicers. Each of these producers a % which works correctly. Each returns the % of revenue a selected company is responsible from the total revenue of several companies at a specific date.
An example of a what I'm getting is (red text added for clarity) -
SELECTEDCOMPANY[Revenue_LastDate_%ofPeers] = 13.23%
SELECTEDCOMPANY[Revenue_FirstDate_%ofPeers] = 9.67%
And the if statement ...
IF(SELECTEDCOMPANY[Revenue_LastDate_%ofPeers] 13.23% >SELECTEDCOMPANY[Revenue_FirstDate_%ofPeers] 9.67% , " It's position strengthened relative to its peers " , " It's position weakened relative to its peers ")
The result should be result... " It's position strengthened relative to its peers " but it's returning "It's position weakened relative to its peers"
Here are some examples of other results I get based upon the two measures (SELECTEDCOMPANY[Revenue_LastDate_%ofPeers] and SELECTEDCOMPANY[Revenue_FirstDate_%ofPeers]) which shows the ranom results I am getting:
Revenue_FirstDate_%ofPeer | Revenue_LastDate_%ofPeer | If statement returns | Should return |
13.23 | 10.1 | Weakened | Weakened |
13.23 | 9.05 | Strengthened | Weakened |
10.59 | 9.05 | Strengthened | Weakened |
10.59 | 11.32 | Strengthened | Strengthened |
9.67 | 11.25 | Weakened | Strengthened |
9.67 | 9.5 | Weakened | Weakened |
9.67 | 10.1 | Weakened | Strengthened |
Any ideas?