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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
lost_flower
Helper III
Helper III

Don't count before starting date

Hello,

 

I try to count my lost customers and my visual looks like

 

lost_flower_0-1677227070419.png

 

where Lost = IF([Netamount_mon])=BLANK(),1,0) and year and month come from a date table.

Since customer A first purchased date is Oct 2021, it should not count as lost.

 

I tried IF('Date'[Date] < [first purchased date], BLANK(),...), but the date table does not work with IF function.

 

Happy for any idea.

 

Thanks a lot

 

1 ACCEPTED SOLUTION
andhiii079845
Solution Sage
Solution Sage

Works fine in may case: (right the table via dimDate)

andhiii079845_0-1677230956074.png

andhiii079845_2-1677231057024.png

 

 

andhiii079845_1-1677231030769.png

Can you post your data model please? 





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

Proud to be a Super User!




View solution in original post

5 REPLIES 5
andhiii079845
Solution Sage
Solution Sage

Works fine in may case: (right the table via dimDate)

andhiii079845_0-1677230956074.png

andhiii079845_2-1677231057024.png

 

 

andhiii079845_1-1677231030769.png

Can you post your data model please? 





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

Proud to be a Super User!




aaaahhhh, my relationship was not correct. Thank so much. Now it works. 😇😇😇😇😇😇😇😇😇

lost_flower
Helper III
Helper III

Thanks for your help. When I try your DAX I receive the same error 😞

 

lost_flower_0-1677229543348.png

My Date comes from a different Date Table. This is exactly where I struggle

I should mention that I tried it as a measure

You have to use the by VAR firstime the date column from "6_lost"
VAR currenttime you have to use the date column from "6_lost"





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

Proud to be a Super User!




andhiii079845
Solution Sage
Solution Sage

My solution: Tabelle2

andhiii079845_1-1677229066306.png

Via DAX, your old value:

Lost = IF(sum(Tabelle2[Amount])>0,0,1)
New DAX:
Lost_new = 
 VAR firsttime = CALCULATE(min(Tabelle2[Date]),FILTER(ALL(Tabelle2),Tabelle2[Amount]>0))
 VAR currenttime = MAXX(Tabelle2,Tabelle2[Date])
VAR varnew = IF(sum(Tabelle2[Amount])= 0 && currenttime>firsttime,1,0)
RETURN varnew
 
Result:
andhiii079845_2-1677229167162.png

 





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

Proud to be a Super User!




Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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