Forum Discussion
Import excel table with dynamic images
- 5 years ago
Hi Irwin ,
Create 2 measures as below:
Measure_output1 = IF(ISFILTERED(Table2[Column1]), SWITCH(SELECTEDVALUE(Table2[Column1]), "Happy", CALCULATE(MAX('Table1'[Output 1]),FILTER('Table1','Table1'[Output 1]="😊")), "Medium", CALCULATE(MAX('Table1'[Output 1]),FILTER('Table1','Table1'[Output 1]="🤔")), "Sad", CALCULATE(MAX('Table1'[Output 1]),FILTER('Table1','Table1'[Output 1]="😢"))), CALCULATE(MAX('Table1'[Output 1]),FILTER('Table1','Table1'[A]=SELECTEDVALUE(Table1[A]))))Measure_output2 = IF(ISFILTERED(Table2[Column1]), SWITCH(SELECTEDVALUE(Table2[Column1]), "Happy", CALCULATE(MAX('Table1'[Output 2]),FILTER('Table1','Table1'[Output 2]="😊")), "Medium", CALCULATE(MAX('Table1'[Output 2]),FILTER('Table1','Table1'[Output 2]="🤔")), "Sad", CALCULATE(MAX('Table1'[Output 2]),FILTER('Table1','Table1'[Output 2]="😢"))), CALCULATE(MAX('Table1'[Output 1]),FILTER('Table1','Table1'[A]=SELECTEDVALUE(Table1[A]))))And you will see:
For the related .pbix file,pls see attached.
Best Regards,
KellyDid I answer your question? Mark my post as a solution!
Thank you.
So this means I can still import the dynamic values (1,2,3) and then create the image display in PowerBi itself?
- amitchandak5 years ago
Super User
Irwin , You can import excel as data. Unichar and some other formats can be used to create images. You have a check that out
Unichar :
https://community.powerbi.com/t5/Desktop/FORMAT-icon-set-for-use-in-a-data-card/td-p/811692
https://exceleratorbi.com.au/dax-unichar-function-power-bi/ - v-kelly-msft5 years ago
Community Support
Hi Irwin ,
Not sure whether I understand correctly. Coud you pls attach some screenshots to make your requirement more clear?
Best Regards,
KellyDid I answer your question? Mark my post as a solution!
- Irwin5 years ago
Helper IV
Sure.
I think most of the problem stems from me being super new to all of this.
The below scren is what I have made in excel. When I change a value (sad/medium/happy... could as well be 1,2,3) the smiley changes correspondingly. I would like to be able to change the value (sad/medium/happy) in excel and then the smiley table would import this value in PowerBi.I now realize that I need to create the value to image part inside powerbi, however, watching tutorials have not quite equiped me to do so yet on my own 😉
Any help is appreciated!- v-kelly-msft5 years ago
Community Support
Hi Irwin ,
First create dim table as below:
Then create 2 measures as below:
Measure_emoji1 = SWITCH(SELECTEDVALUE('dim table'[category]), "happy", CALCULATE(MAX('Table'[emoj 1]),FILTER('Table','Table'[emoj 1]=UNICHAR("128512"))), "angry", CALCULATE(MAX('Table'[emoj 1]),FILTER('Table','Table'[emoj 1]=UNICHAR("128520"))))Measure_emoji2 = SWITCH(SELECTEDVALUE('dim table'[category]), "happy", CALCULATE(MAX('Table'[emoj 2]),FILTER('Table','Table'[emoj 2]=UNICHAR("128512"))), "angry", CALCULATE(MAX('Table'[emoj 2]),FILTER('Table','Table'[emoj 2]=UNICHAR("128520"))))And you will see:
For the unichar of emoji,see below for reference:
https://powerbidocs.com/2020/06/08/how-to-use-emojis-emotions-on-power-bi/
My sample .pbix file is attached,you may turn to it if needed.
Best Regards,
KellyDid I answer your question? Mark my post as a solution!