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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Dvilches_
Frequent Visitor

EARLIER FUNCTION

Hello everyone,

 

I hope you're doing great. I made a column calculation (in FacSales table) that identifies in wich date a company started working with us trough this expresion: 

 
Customer Initialization = CALCULATE(MIN(DimCalendar[Date]),FILTER(FacSales,FacSales[RUT] = EARLIER(FacSales[RUT])))
 
So far so good, but now i would like:
 
  1.  Try to do this expresion but now in a measure.
  2. Due that my report is made with months views, i would like just to see the new clients that appear in the current month. All the dates of the incorporations of the companies are shown, but my intention is only to show the one of the month that I have filtered in the slicer. I don't know very well how to do this since the relationship is between the DimCalendar date and FacSales through the [Fecha_OT] field and not between the "Customer Initialization" field, which is the column I created earlier.

Any recommendation will be well received.

 

Thak you very much.

 

 

Diego V.

3 REPLIES 3
Anonymous
Not applicable

You should never, ever create a calculated column in a fact table using CALCULATE unless the fact table is really tiny. On real fact tables it's going to take a lot of time to calculate. Very often it just leads to a crash due do the amount of memory needed.

 

[Cust Init Date] =
IF( HASONEVALUE( DimCustomer[CustomerID] ),
    CALCULATE(
        MIN( FactSales[Fecha_OT] ),
        ALLEXCEPT(
            FactSales,
            DimCustomer
        )
    )
)

Daxer, i think that i found the way using another measuere that uses your recomended measure:

 

Measure = CALCULATE([Cust Init Date], FILTER(FacSales, MONTH(FacSales[Fecha_OT]) = MONTH([Cust Init Date])))
 
So thank you again.

Thanks for the feedback daxer, i got same result. Now how can i get just dates depending on selected value in slicer? (Using something like ALLSELECTED?)

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

August Carousel

Fabric Community Update - August 2024

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