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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Interactive Visualization using measure

Hi,

I have a Table Visualization where I have used the conditional formating to highlight cells using the measures to  get the output like this:

(Highlight weight column if 1  in weightmeasures and same for length)

Capture1.PNG

Until here this is working.

 

Now I have created another measures which will give me the count of 1s and % of all the 1s in both the above measure:

countrows(filter('Sheet1 (2)','Sheet1 (2)'[LengthMeasure]=1))
count weight = countrows(filter('Sheet1 (2)','Sheet1 (2)'[WeightMeasure]=1))
% Length of highlight = Countrows(Filter('Sheet1 (2)','Sheet1 (2)'[Count Length]=1))/Countrows(FILTER('Sheet1 (2)','Sheet1 (2)'[Count Length](All('Sheet1 (2)'))))
% Weight of highlight = Countrows(Filter('Sheet1 (2)','Sheet1 (2)'[count weight]=1))/Countrows(FILTER('Sheet1 (2)','Sheet1 (2)'[count weight](All('Sheet1 (2)'))))

I put this measure in a Pie chart but there is no interaction between the Pie chart and the table. or Funnel chart and table. (screesnhot below)

 

When I select the count weight in pie chart it should pull the highlighted rows for the weight. but it is not doing so.

 

any help is greatly appreciated!

@Zubair_Muhammad 

 

attached my file for reference.

https://www.dropbox.com/s/jam3r79hiy4fg7n/Power%20Bi%20sample%20file.pbix?dl=0

 

Thanks,

Tejaswi

 

Capture2.PNG

 

1 ACCEPTED SOLUTION

Hey @Anonymous ,

 

here you will find my solution: https://tommartens-my.sharepoint.com/:u:/g/personal/tom_minceddata_com/EVmBYJeFMy5Jk-3lVENMeJUBTEuDeAMbJVsIZJ0GfMbtKA?e=RGl3hZ

 

Until you managed to have a dedicated table (consider to ask the owner of the dataset, if you are using direct query or live connection) that just contains the items "Weight" and "Length", it can not be accomplished what you are aiming (see my first post). I called the table "Weight and Length" and the table looks like this:

image.png

 

I created these two measures:

count combined = 
SUMX(
    VALUES('Weight and Length'[Weight and Length])
    , var _weightORlength = 'Weight and Length'[Weight and Length]
    return
    SWITCH(_weightORlength
    , "weight" , [count weight]
    , "length" , [Count Length]
    )
) 

and 

filter the rows = 
var _theTable = VALUES('Weight and Length'[Weight and Length])
return
MAXX(
    'Sheet1 (2)'
    , MAXX(_theTable
        , var _weightORlength = [Weight and Length]
        return
        SWITCH(
            _weightORlength
            , "Weight" , if([WeightMeasure] = 1 , 1 , BLANK())
            , "Length" , IF([LengthMeasure] = 1 , 1 , BLANK())
        )
    )
) 

The 2nd measure returns 1 if the "proper" measure flags a row (identified by the column ID) to be highlighted, this means if no "segment" of the new pie chart is selected, both criteria are considered.

Using the table and the measure [count combined] allows to create a piecahrt (the pie chart at the bottom):

image.png

I used the seceond measure to filter the rows, depending on the selection on my pie chart:

image.png

 

And here is a little gif that shows how it works:

using a pie to filter a table by value.gif

Hopefully this provides a new perspective to your problem.

 

Regards,

Tom 

 

 

 

 

 



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

@TomMartens @Zubair_Muhammad @jdbuchanan71 @Greg_Deckler @Sean @MarcelBeug 

 

Any help greatly appreciated!

 

~ Tejaswi

Hey,

 

basically this will not work, this is due to the following:

  • you can't pick up the selection of a measure, as there is no corresponding HASONEVALUE function available that tells you what kind of measure is selected.

Because of this you have to think about another approach.

My approach would be:

  • create a simple table that just contains the items "weight" and "length"
  • create a measure that combines both of your measures "count length" and "count weight" and use this measure on your pie chart
  • create a new measure that picks up the selection of a pie segment using "HASONEVALUE('the new table'[weight or length])" or more generally VALUES('the new table'[weight or length]), depending on this selection you can use to check the value of your existing measures, if the condition is met to show a row, the measure has to return 1, otherwise BLANK().
  • add the new measure to the visual filter of the table and check for the value 1.

Hopefully this provides you with some ideas.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany
Anonymous
Not applicable

Hi,

 

Have you had a chance to go thru this?

 

Appreaciate your help!

 

Thanks,

Tejaswi

Hey @Anonymous ,

 

here you will find my solution: https://tommartens-my.sharepoint.com/:u:/g/personal/tom_minceddata_com/EVmBYJeFMy5Jk-3lVENMeJUBTEuDeAMbJVsIZJ0GfMbtKA?e=RGl3hZ

 

Until you managed to have a dedicated table (consider to ask the owner of the dataset, if you are using direct query or live connection) that just contains the items "Weight" and "Length", it can not be accomplished what you are aiming (see my first post). I called the table "Weight and Length" and the table looks like this:

image.png

 

I created these two measures:

count combined = 
SUMX(
    VALUES('Weight and Length'[Weight and Length])
    , var _weightORlength = 'Weight and Length'[Weight and Length]
    return
    SWITCH(_weightORlength
    , "weight" , [count weight]
    , "length" , [Count Length]
    )
) 

and 

filter the rows = 
var _theTable = VALUES('Weight and Length'[Weight and Length])
return
MAXX(
    'Sheet1 (2)'
    , MAXX(_theTable
        , var _weightORlength = [Weight and Length]
        return
        SWITCH(
            _weightORlength
            , "Weight" , if([WeightMeasure] = 1 , 1 , BLANK())
            , "Length" , IF([LengthMeasure] = 1 , 1 , BLANK())
        )
    )
) 

The 2nd measure returns 1 if the "proper" measure flags a row (identified by the column ID) to be highlighted, this means if no "segment" of the new pie chart is selected, both criteria are considered.

Using the table and the measure [count combined] allows to create a piecahrt (the pie chart at the bottom):

image.png

I used the seceond measure to filter the rows, depending on the selection on my pie chart:

image.png

 

And here is a little gif that shows how it works:

using a pie to filter a table by value.gif

Hopefully this provides a new perspective to your problem.

 

Regards,

Tom 

 

 

 

 

 



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany
Anonymous
Not applicable

Thanks @TomMartens ,

 

Your solution is what I am lookign for. I will ask to add the table.

 

Thanks,

Tejaswi

Anonymous
Not applicable

HI @TomMartens ,

Thanks for your reply!

 

-->When you say Create sample table , do you mean a visualization table or create new table?

The reason I am asking is because if I have to create a Table than I won't able to do it as for this project I do not have access to Edit queries.

--> I tried to combine the two measures something like this.  but I get an error: can you help me with this?

Capture3.PNG

 

 

Thanks,

Tejaswi

 

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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