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 August 31st. Request your voucher.
I have a table with a one measure formula:
Financial Value =
SWITCH(
SELECTEDVALUE('Sort Table'[line description]),
"Minutes Expenses",[ Minute expenses],
"Total Expenses",[ total Expenses]
"Business Expenses",[ Business Expenses],
"Payroll Expenses",[ Payroll Expenses],
"Revenue",[ Total revenue],
"Taxes",[ Total revenue]*taxes]),
"Net Profit" , [Net profit]))
I want to apply a formula to the net profit to give me a condition for if number is negative then show me a red number and if number is positive then show me green color is there a way?
Solved! Go to Solution.
Hi @Anonymous ,
I have modified the measure.
Financial Value =
SWITCH (
SELECTEDVALUE ( 'Sort Table'[line description] ),
"Minutes Expenses", [ Minute expenses],
"Total Expenses", [ total Expenses],
"Business Expenses", [ Business Expenses],
"Payroll Expenses", [ Payroll Expenses],
"Revenue", [ Total revenue],
"Taxes", [ Total revenue] * [taxes],
"Net Profit", [Net profit]
)
Then create a measure based on the [Financial Value] measure.
Measure =
IF (
MAX ( 'Sort Table'[line description] ) = "Net Profit"
&& [Net profit] < 0,
"Red",
IF (
MAX ( 'Sort Table'[line description] ) = "Net Profit"
&& [Net profit] >= 0,
"Green",
BLANK ()
)
)
Then use the condition format like the following.
If I have misunderstood your meaning, please provide your pbix file without privacy information and your desired output with more details.
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
I have modified the measure.
Financial Value =
SWITCH (
SELECTEDVALUE ( 'Sort Table'[line description] ),
"Minutes Expenses", [ Minute expenses],
"Total Expenses", [ total Expenses],
"Business Expenses", [ Business Expenses],
"Payroll Expenses", [ Payroll Expenses],
"Revenue", [ Total revenue],
"Taxes", [ Total revenue] * [taxes],
"Net Profit", [Net profit]
)
Then create a measure based on the [Financial Value] measure.
Measure =
IF (
MAX ( 'Sort Table'[line description] ) = "Net Profit"
&& [Net profit] < 0,
"Red",
IF (
MAX ( 'Sort Table'[line description] ) = "Net Profit"
&& [Net profit] >= 0,
"Green",
BLANK ()
)
)
Then use the condition format like the following.
If I have misunderstood your meaning, please provide your pbix file without privacy information and your desired output with more details.
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
yesss it works thank you very much but can you help me add also for revenue and total expenses? like if ="revenue" then green and if = "total expenses" then red. can i add it to the measure you provided me?
Hi @Anonymous ,
Of course. Please refer to the formula.
Measure =
IF (
MAX ( 'Sort Table'[line description] ) = "Net Profit"
&& [Net profit] < 0,
"Red",
IF (
MAX ( 'Sort Table'[line description] ) = "Net Profit"
&& [Net profit] >= 0,
"Green",
IF (
MAX ( 'Sort Table'[line description] ) = "revenue",
"Green",
IF (
MAX ( 'Sort Table'[line description] ) = "total expenses",
"Red",
BLANK ()
)
)
)
)
If I have misunderstood your meaning, please your desired output with more details.
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you very much but i found another way i used your if measure first for the net profit formula and for the revenue and total expense i used the switch formula:
User | Count |
---|---|
13 | |
8 | |
6 | |
6 | |
5 |
User | Count |
---|---|
24 | |
14 | |
13 | |
8 | |
8 |