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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
volt26
Frequent Visitor

Measure to get first matching text from a column (with custom filters) and show it in card visual

Hello!


I'm trying to do something that I thought was simple but I hit another wall...

 

I created a card with these filters on it :

volt26_0-1720031902325.png
it returns this (and it is the desired result) : 

volt26_1-1720031951748.png

 

The problem is, I want to create a measure that will return exactly that and I keep failing. Can you help me out please? Here is what sounded the most logical to me :

Measure = CALCULATETABLE(FIRSTNONBLANK(D_DATE[CYCLE_TEXTE_MOIS_J],D_DATE[CYCLE_TEXTE_MOIS_J]),D_DATE[ANNEE]="2024", D_DATE[CYCLE_SEQ]="1")

I get this on the card :
volt26_2-1720032293294.png

 



Thank you for your help!
1 ACCEPTED SOLUTION
volt26
Frequent Visitor

I think I found the correct formula but somehow, the result is blank and it shouldnt!!

Measure =
CALCULATE(
    MIN('D_DATE'[CYCLE_TEXTE_MJ]),
    FILTER(D_DATE,[CYCLE_SEQ]="2")
)


If I look at the table, I can see there is no blank values. The MIN value I should get is "03-11 au 04-14" :
volt26_0-1720102200810.png

 

View solution in original post

6 REPLIES 6
volt26
Frequent Visitor

Oooops!

That last formula did the trick. The only reason it didn't work is I had another filter going on that I forgot about.

 

Thank you for your help! It pointed me in the right direction!

volt26
Frequent Visitor

I think I found the correct formula but somehow, the result is blank and it shouldnt!!

Measure =
CALCULATE(
    MIN('D_DATE'[CYCLE_TEXTE_MJ]),
    FILTER(D_DATE,[CYCLE_SEQ]="2")
)


If I look at the table, I can see there is no blank values. The MIN value I should get is "03-11 au 04-14" :
volt26_0-1720102200810.png

 

v-tianyich-msft
Community Support
Community Support

Hi @volt26 ,

 

I think on a small mistake, I did notice that 2024 is a number in your filter and the expression uses quotes to change it to a text type, so removing the quotes from 2024 in the expression would return the correct answer.

 

Hope it helps!

 

Best regards,
Community Support Team_ Scott Chang

 

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

I know it sounds weird but this column is set as string in the database. I believe it is to allow the user to enter other stuff than a year... Unfortunately, I can't change anything about that.

ryan_mayu
Super User
Super User

maybe you can try this

 

Measure = CALCULATE(MIN(D_DATE[CYCLE_TEXTE_MOIS_J],D_DATE[CYCLE_TEXTE_MOIS_J]),D_DATE[ANNEE]="2024"D_DATE[CYCLE_SEQ]="1")




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

Proud to be a Super User!




Unfortunately it doesn't work. It doesn't accept the 2nd D_DATE[CYCLE_TEXTE_MOIS_J]

volt26_0-1720098022793.png

 

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 FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

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