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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
rdegr
Helper I
Helper I

Help for selector JSON

What is represented by the value of the 't' attribute below? I need to build similar selectors, that doesn't seem to correspond to anything in the metadata for the related category. I'm trying to build a filter that lets you select different fields, then a value from the field, but createSelectionId() is creating selectors that filter across multiple fields which is not desired.

 

"{"selector":"{\"data\":[\"{\\\"comp\\\":{\\\"k\\\":0,\\\"l\\\":{\\\"col\\\":{\\\"s\\\":{\\\"e\\\":\\\"qtEmergencyRecords\\\"},\\\"r\\\":\\\"Year\\\"}},\\\"r\\\":{\\\"const\\\":{\\\"t\\\":4,\\\"v\\\":2017}}}}\"]}","highlight":false}"

3 REPLIES 3
hairstyledare55
New Member

Thanks for clarifying that it's a captured selector string from a Power BI visual interaction.

The t attribute inside the JSON ("t":4) typically represents the data type of the constant value. In Power BI's internal selector system:

  • t:1 is usually text/string

  • t:2 is boolean

  • t:3 is decimal/float

  • t:4 is integer

So "t":4, "v":2017 means you're filtering the Year column by the integer value 2017.

If you want to dive deeper into how selectors and JSON structures work for filtering and visualization, I recommend checking out some detailed tutorials and tools at @https://artdrivethru.com/json-formatter . They have useful resources on JSON formatting and selector logic that might help with your project.

For your use case, make sure to construct the createSelectionId() call carefully to target just one field at a time to avoid unwanted cross-field filtering.

Hope this helps!

irisp
New Member

First please format and validate your JSON data using 

 

Irisp, that's not "my" JSON, its a selector query string I captured while debugging selection activities. It's string data from a larger JSON object, thus the escapes. Can you answer my question?

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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