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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Working with Play Axis Visual with blank values for the filter

Hi, 

 

I have a Play Axis Visual that runs the ID to filter my report, that ID number goes from 1 to 10 and I have 4 tables with the ID column, but not all have 10 ID items.

For example, my table 1:

ID

Message

1

Message 1

2

Message 2

3

Message 3

4

Message 4

5

Message 5

 

My table 2:

ID

Product

1

Product 1

2

Product 2

3

Product 3

4

Product 4

5

Product 5

6

Product 6

7

Product 7

8

Product 8

9

Product 9

10

Product 10

 

When my play axis is running at ID 6, my card in table 1 is blank and I needed to create some way to bring a random value (considering MIN (table1 [ID]) and MAX (table1 [ID])) when the value field is equal to blank.

 

Could someone help me on how to solve this problem?

 

Another question I have is whether there is a way to use 2 play axis in the same page? I tried to do it, but one play axis ends up interfering with the other.

 

Thanks a lot!

1 ACCEPTED SOLUTION
v-eqin-msft
Community Support
Community Support

Hello @vmzandonadi ,

In my opinion, you want to use the visual card to display the selected ID in visual Play Axis, when the ID does not exist in Table1, then show randon ID, right?

You can use the following formula:

1. Add a new table with all ID, and then create a column:

Column =
VAR _v =
    LOOKUPVALUE ( Table1[ID], [ID], 'ForSlicer'[ID] )
RETURN
    IF (
        _v = BLANK (),
        RANDBETWEEN ( MIN ( 'Table1'[ID] ), MAX ( 'Table1'[ID] ) ),
        _v
    )

12.1.2.2.PNG

2. Create a measure:

Measure 2 =
IF (
    MAX ( ForSlicer[ID] ) IN VALUES ( 'Table1'[ID] ),
    CALCULATE (
        MAX ( 'Table1'[ID] ),
        FILTER ( 'Table1', 'Table1'[ID] = MAX ( ForSlicer[ID] ) )
    ),
    RANDBETWEEN ( MIN ( 'Table1'[ID] ), MAX ( 'Table1'[ID] ) )
)

My final output looks like this:

12.1.2.1.gif

Here's the pbix file.


Have I answered your question? Please mark my answer as a solution. Thanks a lot.
If not, load some insensitive data samples and expected output.

Best regards
Eyelyn Qin

View solution in original post

4 REPLIES 4
v-eqin-msft
Community Support
Community Support

Hello @vmzandonadi ,

In my opinion, you want to use the visual card to display the selected ID in visual Play Axis, when the ID does not exist in Table1, then show randon ID, right?

You can use the following formula:

1. Add a new table with all ID, and then create a column:

Column =
VAR _v =
    LOOKUPVALUE ( Table1[ID], [ID], 'ForSlicer'[ID] )
RETURN
    IF (
        _v = BLANK (),
        RANDBETWEEN ( MIN ( 'Table1'[ID] ), MAX ( 'Table1'[ID] ) ),
        _v
    )

12.1.2.2.PNG

2. Create a measure:

Measure 2 =
IF (
    MAX ( ForSlicer[ID] ) IN VALUES ( 'Table1'[ID] ),
    CALCULATE (
        MAX ( 'Table1'[ID] ),
        FILTER ( 'Table1', 'Table1'[ID] = MAX ( ForSlicer[ID] ) )
    ),
    RANDBETWEEN ( MIN ( 'Table1'[ID] ), MAX ( 'Table1'[ID] ) )
)

My final output looks like this:

12.1.2.1.gif

Here's the pbix file.


Have I answered your question? Please mark my answer as a solution. Thanks a lot.
If not, load some insensitive data samples and expected output.

Best regards
Eyelyn Qin

Anonymous
Not applicable

Hi @Eyelyn9 thank you so much, this is exactly what I need.

Thanks for sending the pbix file, this made it easier to understand 🙂

Anonymous
Not applicable

@amitchandak thank you for the answer, but it's not exactly what I need. I need for the other charts that I have in my visual to be filtered by ID 6, only for the table 1, I need to randomize (or not maybe some other way) any value between MIN e MAX ID that I have in this table.

 

I don't know if I managed to be clear, maybe create a new column in my table, with the ID values from 1 to 10, and for those that are blank I bring some random data that I have filled in the table.

 

I tried many ways to do it that didn't work, maybe I'm not thinking the right way.

amitchandak
Super User
Super User

@Anonymous , You can use randbetween

if(isblank([measure]), randbetween(MIN (table1 [ID]) , MAX (table1 [ID]))

 

refer

https://www.youtube.com/watch?v=LFAT7AEDk5Q

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.