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
Stuznet
Helper V
Helper V

How to Return Column text based on Filters

I want to know how to return column name/text  based on filters. 

 

 

I'm looking for the ProjectACT return with name filtered by Data=March, Start Year= 2018 and Start Month = Apr

2018-09-11_10-05-10.png 

 

I've tried this formula but is returning only 1 value

Column = CALCULATE(FIRSTNONBLANK(Data[ProjAct],TRUE()),FILTER(Data,Data[Start Year] = "2018"),FILTER(Data,Data[Start Month] = "April"),FILTER(Data,Data[Data] = "March"))

2018-09-11_10-21-16.png

 

Can someone please help?

 

Thank you 🙂 

 

1 ACCEPTED SOLUTION
dobregon
Impactful Individual
Impactful Individual

Hi,

 

I have done the measure 

Projectmeasure = CALCULATE(MAX(Table1[ProjAct]),
    FILTER(Table1,
        Table1[Data]="March"
        &&
        Table1[Start year]=2018
        &&
        Table1[Start Month]="April"
    ))

but in your data source you have a problem becasue it doesn't exist a projectAct related to the filters that you want

If you check value March in column Data, there is only one start year (2017) so, there isn't exist startyear 2018 for a data March

 



Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

View solution in original post

7 REPLIES 7
dobregon
Impactful Individual
Impactful Individual

Hi

Instead of using the comand FILTER that takes all the values in your import query, use the comand ALLSELECTED that analyse only between the filters you selected in your visuals.



Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

I was able to get all the value but the last filter by Data[Data] doesnt seems to be working. I' getting different count 1314 instead of 257

 

April Plan Start = CALCULATE(FIRSTNONBLANK(Data[ProjAct],True()),
FILTER(Data,Data[Start Year] = "2018"),FILTER(Data,Data[Start Month] = "April"),
FILTER(Data,Data[Data] = "March"
&& Data[ProjAct] = EARLIEST(Data[ProjAct])))

2018-09-11_11-19-59.png

 

@dobregonCan you demonstrate? I am clueless what you mean by that.

dobregon
Impactful Individual
Impactful Individual

Maybe it will be easy if you can share the data and a demostration of final result that you need to have in order to give you a better example.

I think now with your last reply you can't use the allselected but, i can't understad now your point if i dont have an example of data source and a demostration in excel of the final value that you want.



Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

 

I'm sorry for the confusion.

 

Below is the data from Excel. So basically what I want is the ProjAct column that is filter by Data = March, Start Year = 2018, Start Month = April. 

DataStart yearStart MonthProjAct
March2017June140609F01140609F01I096
April2018March140618T01140618T01I045
March2017Apr140618T01140618T01I096
May2018July140620U01140620U01I045
June2018August140908A01140908A01I045
April2018April141210A18141210A18I045
dobregon
Impactful Individual
Impactful Individual

Hi,

 

I have done the measure 

Projectmeasure = CALCULATE(MAX(Table1[ProjAct]),
    FILTER(Table1,
        Table1[Data]="March"
        &&
        Table1[Start year]=2018
        &&
        Table1[Start Month]="April"
    ))

but in your data source you have a problem becasue it doesn't exist a projectAct related to the filters that you want

If you check value March in column Data, there is only one start year (2017) so, there isn't exist startyear 2018 for a data March

 



Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

@dobregonthank you so much for your help. But is close enough to the result I wanted. Your formula does work 🙂 

dobregon
Impactful Individual
Impactful Individual

you're welcome!



Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

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.