Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello All,
I could use help with the Switch ( TRUE () function.
If I use a calculated value the switch result is null
However, if I hardcode a number in the switch instead of the calculated field, it works fine.
There is data in [Income] in a normal matrix column. Thank you for any help - I greatly appreciate it!
Solved! Go to Solution.
Hi @rmbuchan
Your [PL Actuals] measure is told to return the value of [Income] when the row index is 3.
[Income] calculates [PL Values] when the Category is Income. This is the problem. The Category for rows with row index 3 is Total Income. That's why you're getting a blank here.
You can fix the issue by modifying this line in the SWITCH to
CRSindex = 3, CALCULATE([PL Values], 'RPT Income Statement'[Category] = "Total Income"),
Regards
Phil
Proud to be a Super User!
Hi @rmbuchan ,
Whether the advice given by @PhilipTreacy has solved your confusion, if the problem has been solved you can mark the reply for the standard answer to help the other members find it more quickly. If not, please point it out.
Looking forward to your feedback.
Best Regards,
Henry
Hi @rmbuchan
Your [PL Actuals] measure is told to return the value of [Income] when the row index is 3.
[Income] calculates [PL Values] when the Category is Income. This is the problem. The Category for rows with row index 3 is Total Income. That's why you're getting a blank here.
You can fix the issue by modifying this line in the SWITCH to
CRSindex = 3, CALCULATE([PL Values], 'RPT Income Statement'[Category] = "Total Income"),
Regards
Phil
Proud to be a Super User!
Phil,
You are AMAZING - this solved the problem. Thank you so much for sticking with this issue and putting all the time in that you did!
No worries @rmbuchan , glad to help.
Phil
Proud to be a Super User!
Hi @rmbuchan
Can you supply your PBIX file please.
Regards
Phil
Proud to be a Super User!
Phil,
I sent you a link to the file in DropBox - thank you for your help!
Hi @rmbuchan
It may very well produce values when charted but it's how the value is calculated when it's in the matrix that is the issue.
I presume [PL Values] is a measure? How is that calculated?
Can you provide your file? It woudl be easier to check if I have that.
Regards
Phil
Proud to be a Super User!
Philip,
Yes, PL Values is a measure. Here is the calculation:
Hi @rmbuchan
How are you calculating [Income]? That would seem to be the issue.
Regards
Phil
Proud to be a Super User!
Philip,
Great question. I thought the same thing. I put the measure into a chart and it produces results. I also have the formula shown here:
It just doesn't work in the Switch. Thanks for your assistance...
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
104 | |
101 | |
79 | |
72 | |
64 |
User | Count |
---|---|
142 | |
108 | |
101 | |
81 | |
74 |