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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
artlearning
Regular Visitor

Firstnonblank not working without month month column

Hello everyone - I'm trying to get the very first month name where I have a transaction. I tried to use Firstnonblank but it's not working as expected. Here's my dataset

 

CustomerAugust, 2022September, 2022November, 2022December 2022
A11  
B  55

 

I tried this expression 

 

Cust Firt Order:=FIRSTNONBLANK(Sales[Fiscal Month],[Lics]>0)

 

But is not working for all cases

 

CustomerCust First Order
AAugust, 2022
BDecember, 2022

 

For customer A, I get the correct date since the first transaction ocurred in August, but for customer B, I'm getting the December date when I should get November.

 

Appreciate your help!

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@artlearning , Make sure you are using a date table , use date in place of month name, month name are not sortable , Create date from Month Year

 

calculate(firstnonblankvalues(Date[Date], [Value Measure]) )

 

or

 

calculate(firstnonblankvalues(Date[Date] ), [Value Measure]), filter( allselected(Table), Table[Customer] = max(Table[Customer]) ) )

 

 

Also, you can explore the Index function

 

Power BI Index function: Top/Bottom Performer by name and value- https://youtu.be/HPhzzCwe10U

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@artlearning , Make sure you are using a date table , use date in place of month name, month name are not sortable , Create date from Month Year

 

calculate(firstnonblankvalues(Date[Date], [Value Measure]) )

 

or

 

calculate(firstnonblankvalues(Date[Date] ), [Value Measure]), filter( allselected(Table), Table[Customer] = max(Table[Customer]) ) )

 

 

Also, you can explore the Index function

 

Power BI Index function: Top/Bottom Performer by name and value- https://youtu.be/HPhzzCwe10U

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

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 MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.