Forum Discussion
EaglesTony
Post Prodigy
3 years agoHow do I show 2 columns in a query table in a text box instead of the table visual?
Hi, I have the following in a table: Green 50 Yellow 20 Red 100 I don't want to show this on the report as a table, but as text as such: "Total Green: 50" "Total Yellow:...
- 3 years ago
The issue was the columns needed flipped around. Measure = var a="Green" var b="Yellow" var c="Red" var _avalue =LOOKUPVALUE(Append1[Count],Append1[AgingDaysColor],a) var _bvalue=LOOKUPVALUE(Append1[Count],Append1[AgingDaysColor],b) var _cvalue=LOOKUPVALUE(Append1[Count],Append1[AgingDaysColor],c) return "Total"&" "&a&":"&" "&_avalue&UNICHAR(10)& "Total"&" "&b&":"&" "&_bvalue&UNICHAR(10)& "Total"&" "&c&":"&" "&_cvalue
EaglesTony
Post Prodigy
3 years agoHi,
I tried your suggestion, but getting a syntax error "The syntax for "Total" is incorrect.
Here is what I have:
Measure = var a="Green" var b="Yellow" var c="Red" var _avalue =LOOKUPVALUE(Append1[AgingDaysColor],Append1[Count],a) var _bvalue=LOOKUPVALUE(Append1[AgingDaysColor],Append1[Count],b) var _cvalue=LOOKUPVALUE(Append1[AgingDaysColor],Append1[Count],c) "Total"&" "&a&":"&" "&_avalue&UNICHAR(10)&
"Total"&" "&b&":"&" "&_bvalue&UNICHAR(10)&
"Total"&" "&c&":"&" "&_cvalue
Anonymous
3 years agoNot applicable
Hi EaglesTony
You need to add "return ", you can refer to the following measure
Measure = var a="Green"
var b="Yellow"
var c="Red"
var _avalue =LOOKUPVALUE(Append1[AgingDaysColor],Append1[Count],a)
var _bvalue=LOOKUPVALUE(Append1[AgingDaysColor],Append1[Count],b)
var _cvalue=LOOKUPVALUE(Append1[AgingDaysColor],Append1[Count],c)
return "Total"&" "&a&":"&" "&_avalue&UNICHAR(10)&
"Total"&" "&b&":"&" "&_bvalue&UNICHAR(10)&
"Total"&" "&c&":"&" "&_cvalue
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- EaglesTony3 years ago
Post Prodigy
I tried this but when I put the field to the card, I am getting an error:
AgingDaysColor is Text, Count is a Whole Number
- EaglesTony3 years ago
Post Prodigy
The issue was the columns needed flipped around. Measure = var a="Green" var b="Yellow" var c="Red" var _avalue =LOOKUPVALUE(Append1[Count],Append1[AgingDaysColor],a) var _bvalue=LOOKUPVALUE(Append1[Count],Append1[AgingDaysColor],b) var _cvalue=LOOKUPVALUE(Append1[Count],Append1[AgingDaysColor],c) return "Total"&" "&a&":"&" "&_avalue&UNICHAR(10)& "Total"&" "&b&":"&" "&_bvalue&UNICHAR(10)& "Total"&" "&c&":"&" "&_cvalue