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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
InternetAndy
Frequent Visitor

Not getting separate values when breaking down by labels

I have a dataset pulled from an excel sheet that is manually updated. There is a Task column with 3 values and sometimes a task will go months without any updated values. I'm setting up a report for monthly numbers that will show the latest added values for each task in a month, and if the month had nothing added, uses the most recent values added from a previous month. I also added an index column as sometimes there will be multiple updates on the same day but no timestamp. I was able to pull this off with the following measure:

 

VAR SelectedMonth = MAX('Date'[Date])
VAR SelectedTask = "instance segmentation"
RETURN
    CALCULATE(
        LASTNONBLANK('Sheet1'[AP50], 1),
        FILTER(
            ALL('Sheet1'),
            'Sheet1'[Task] = SelectedTask &&
            'Sheet1'[Train Date] <= SelectedMonth &&
            NOT ISBLANK('Sheet1'[AP50]) &&
            RANKX(
                FILTER(
                    ALL('Sheet1'),
                    'Sheet1'[Task] = SelectedTask &&
                    'Sheet1'[Train Date] <= SelectedMonth &&
                    NOT ISBLANK('Sheet1'[AP50])
                ),
                'Sheet1'[Index],
                ,
                DESC,
                Dense
            ) = 1
        )
    )
I've copied a version of this measure for different tasks and values, and have all worked great. I tested it with a date slicer and everything is showing correct values.
However, one of the tasks is broken down into mutiple labels in a [Label Name] column, and when I adjust the SelectedTask variable to the updated task and add it to a table with the these labels, they all show the same value. It is also blank for months where nothing was updated for the task. I'm thinking it's just a filtering issue but I'm not sure what needs adjusting.
1 REPLY 1
some_bih
Super User
Super User

Hi @InternetAndy check part 

VAR SelectedTask = "instance segmentation"

you shoud have some function in part after = , like VAR SelectedTask =FILTER(<Your table>, <your column>= "instance segmentation") 

I hope this help





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!






Helpful resources

Announcements
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.