Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

SELECTEDVALUE NOT WORKING WITH FORMAT FUNCITON

Hi all,

I setup a slicer to dinamically change the values in the tiles based upon the selection there, using the code below:

 

Selection KPI =
Switch (True (),
Selectedvalue ('KPI Table'[KPI]) = "Case Fill %", [Case Fill %],
Selectedvalue ('KPI Table'[KPI]) = "Unit Fill Rate %", [Unit Fill Rate %],
Selectedvalue ('KPI Table'[KPI]) = "Supply Perfect Orders %", [Supply Perfect Orders %],
Selectedvalue ('KPI Table'[KPI]) = "Perfect Orders %", [Perfect Orders %],
Selectedvalue ('KPI Table'[KPI]) = "Delivery on Time (Order)", [Delivery on Time (Order)],
Selectedvalue ('KPI Table'[KPI]) = "Delivery on Time (Line)", [Delivery on Time (Line)],
Selectedvalue ('KPI Table'[KPI]) = "Delivery Perfect Order", [Delivery Perfect Order %],
Blank())

 

2019-09-25_9-41-55.jpg

 

When I tried to use FORMAT to have the number in percent  I am gettig the BLANK results

 

Selection KPI =
Switch (True (),
Selectedvalue ('KPI Table'[KPI]) = "Case Fill %", FORMAT([Case Fill %],"0%"),
Selectedvalue ('KPI Table'[KPI]) = "Unit Fill Rate %", FORMAT[Unit Fill Rate %],"0%")
Selectedvalue ('KPI Table'[KPI]) = "Supply Perfect Orders %", FORMAT[Supply Perfect Orders %],"0%")
Selectedvalue ('KPI Table'[KPI]) = "Perfect Orders %", FORMAT[Perfect Orders %],"0%")
Selectedvalue ('KPI Table'[KPI]) = "Delivery on Time (Order)", [Delivery on Time (Order)],
Selectedvalue ('KPI Table'[KPI]) = "Delivery on Time (Line)", [Delivery on Time (Line)],
Selectedvalue ('KPI Table'[KPI]) = "Delivery Perfect Order", FORMAT([Delivery Perfect Order %],"0%")
Blank())

2019-09-25_9-43-55.jpg

 

Any ideas how I can fix that?

 

Cheers,

 

Gilly

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @v-lid-msft ,

 

Just realized that the issue was with the tile (Sparkline By Okviz) that I was using, have changed the starndard one and it working now.

View solution in original post

3 REPLIES 3
v-lid-msft
Community Support
Community Support

Hi @Anonymous ,

 

We found there are some syntax error in your formula, could you please try the following formula?

 

Selection KPI =
SWITCH (
    TRUE (),
    SELECTEDVALUE ( 'KPI Table'[KPI] ) = "Case Fill %", FORMAT ( [Case Fill %], "0%" ),
    SELECTEDVALUE ( 'KPI Table'[KPI] ) = "Unit Fill Rate %", FORMAT ( [Unit Fill Rate %], "0%" ),
    SELECTEDVALUE ( 'KPI Table'[KPI] ) = "Supply Perfect Orders %", FORMAT ( [Supply Perfect Orders %], "0%" ),
    SELECTEDVALUE ( 'KPI Table'[KPI] ) = "Perfect Orders %", FORMAT ( [Perfect Orders %], "0%" ),
    SELECTEDVALUE ( 'KPI Table'[KPI] ) = "Delivery on Time (Order)", [Delivery on Time (Order)],
    SELECTEDVALUE ( 'KPI Table'[KPI] ) = "Delivery on Time (Line)", [Delivery on Time (Line)],
    SELECTEDVALUE ( 'KPI Table'[KPI] ) = "Delivery Perfect Order", FORMAT ( [Delivery Perfect Order %], "0%" ),
    BLANK ()
)

Best regards,

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi @v-lid-msft,

 

Have tried your formula but still getting the blank results.

 

2019-09-26_8-39-48.jpg

Anonymous
Not applicable

Hi @v-lid-msft ,

 

Just realized that the issue was with the tile (Sparkline By Okviz) that I was using, have changed the starndard one and it working now.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.