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
Gajo
Helper I
Helper I

Working with filtered data

I have a table with some columns with indexes and 1 column with data.

When I use a slicer to select some of the indexes I see the selected data in a line chart and in a table on my page.

 

How do I calculate the minimum of the selected data in the table? I either get the minimum of the total unfiltered table or I get a different answer in every selected row when I use ALLSELECTED.

 

Any help would be greatly apreciated.

 

Gajo

9 REPLIES 9
Eric_Zhang
Employee
Employee


@Gajo wrote:

I have a table with some columns with indexes and 1 column with data.

When I use a slicer to select some of the indexes I see the selected data in a line chart and in a table on my page.

 

How do I calculate the minimum of the selected data in the table? I either get the minimum of the total unfiltered table or I get a different answer in every selected row when I use ALLSELECTED.

 

Any help would be greatly apreciated.

 

Gajo


@Gajo

Where do you use the min measure? In a card visual, just

Measure = MIN(Table1[Column3])

min.gif

 

 

For further advice, please post some sample data and expected output in your case.

 Dear Eric,

 

Thanks for your feedback.

What I need is the follwwing: 

The table below shows the selected data (8 out of about 500 rows)

How do I get the MVM column to say the number of rows (8) in stead of the number of rows in the slicer (11)

VualueMin should then be -78.33 in all rows...

 

Any idea if this is possible?

 

Gajo 

 

 

 image.png


@Gajo wrote:

 Dear Eric,

 

Thanks for your feedback.

What I need is the follwwing: 

The table below shows the selected data (8 out of about 500 rows)

How do I get the MVM column to say the number of rows (8) in stead of the number of rows in the slicer (11)

VualueMin should then be -78.33 in all rows...

 

Any idea if this is possible?

 

Gajo 

 

 

 image.png


@Gajo

Then what is wrong with ALLSELECTED? You mentioned that ALLSELECTED doesn't work.

 

ValueMin = MINX(ALLSELECTED(Table1),Table1[value])

MVM = COUNTX(ALLSELECTED(Table1),1)

 

allselected.gif

Hi Eric,

 

COUNTX(ALLSELECTED(Output),1) gives the total number of rows in the table (754) not the number of selected rows (8)

MINX(ALLSELECTED(Output),Output[Value]) Gives also the minimum of all 754 rows...

 

Your image seems to show exactly what I need, but I can't reproduce it in my own file....

Do you have any other suggestions?

 

Update: adding a measure iso a column seems to help... Experimenting now...

How do I use the output of a measure to calculate the next column without haveing the measure switch back to the "all rows" answer? 

 

Gajo


@Gajo wrote:

Hi Eric,

 

COUNTX(ALLSELECTED(Output),1) gives the total number of rows in the table (754) not the number of selected rows (8)

MINX(ALLSELECTED(Output),Output[Value]) Gives also the minimum of all 754 rows...

 

Your image seems to show exactly what I need, but I can't reproduce it in my own file....

Do you have any other suggestions?

 

Update: adding a measure iso a column seems to help... Experimenting now...

 

Gajo


@Gajo

To have a better understanding on your scenario, could you upload the pbix file? You can upload it to Onedrive or any web storage and share the download link. Do note to mask sensitive data before uploading.

Ok One step further:

 

BINS and ValueRange are measures that are changed depending on the data that's selected.

These are then used to calculate the BinNum column, but now this is again using the unfiltered data.

How can I prevent this? A measure won't work because I need to calculate a value for every column...

 

Gajo

image.png

BinNum should be -8 -8 -8 -7 -7 -6 -8 -6

 

Added an extra column: Test = [ValueRange]

 

ValueRange is clearly 8 as can be seen in the table below, but the Test column is 31 and I don't understand why...

image.png

Is there anyone who can help me with this problem?

Am I asking the impossible here or is there just noone who knows the awnser?

As a novice it looks to me that it shoudn't be this hard to add or subtract two numbers in a table...

I ask again: Is there anyone who knows how to combine calculated measures and columns??

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.

Top Solution Authors