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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Comparison curent month values with old month values to get new distinct ID's

I need new ids distinct that are not avaliable in last month but dax that i made not working .

Newly WM_PFs =

VAR Ids = CALCULATETABLE (
VALUES ( InvDetailed_Data[WSFacID] ),
FILTER (
InvDetailed_Data,InvDetailed_Data[InvID]<>"" && NOT(ISBLANK(InvDetailed_Data[InvID])) && InvDetailed_Data[InvType]<>"" && NOT(ISBLANK(InvDetailed_Data[InvType])) && InvDetailed_Data[InvType]<>"Credit Memo" && InvDetailed_Data[InvType]<>"Debit Memo" && InvDetailed_Data[InvProgram]="WM" && InvDetailed_Data[Date Invoice] = CALCULATE ( MAX ( 'Calendar'[Date] ), ALLSELECTED ( 'Calendar' ) ) ))
VAR LastMonthIDs = CALCULATETABLE (
VALUES ( InvDetailed_Data[WSFacID] ),
FILTER (InvDetailed_Data, InvDetailed_Data[InvID]<>"" && NOT(ISBLANK(InvDetailed_Data[InvID])) && InvDetailed_Data[InvType]<>"" && NOT(ISBLANK(InvDetailed_Data[InvType])) && InvDetailed_Data[InvType]<>"Credit Memo" && InvDetailed_Data[InvType]<>"Debit Memo" && InvDetailed_Data[InvProgram]="WM" && InvDetailed_Data[Date Invoice]=DATEADD( 'Calendar'[Date], -1, MONTH )))
RETURN COUNTROWS(DISTINCT( EXCEPT ( Ids, LastMonthIDs ) ))
5 REPLIES 5
AlB
Community Champion
Community Champion

@Anonymous 

can you share the pbix? or a mock one that repros the issue, with the expected result?

 

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

 

SU18_powerbi_badge

 

AlB
Community Champion
Community Champion

@Anonymous 

Newly WM_PFs =
VAR Ids =
    CALCULATETABLE (
        VALUES ( InvDetailed_Data[WSFacID] ),
        FILTER (
            InvDetailed_Data,
            InvDetailed_Data[InvID] <> ""
                && NOT ( ISBLANK ( InvDetailed_Data[InvID] ) )
                    && InvDetailed_Data[InvType] <> ""
                    && NOT ( ISBLANK ( InvDetailed_Data[InvType] ) )
                        && InvDetailed_Data[InvType] <> "Credit Memo"
                        && InvDetailed_Data[InvType] <> "Debit Memo"
                        && InvDetailed_Data[InvProgram] = "WM"
        )
    )
VAR LastMonthIDs =
    CALCULATETABLE (
        VALUES ( InvDetailed_Data[WSFacID] ),
        FILTER (
            InvDetailed_Data,
            InvDetailed_Data[InvID] <> ""
                && NOT ( ISBLANK ( InvDetailed_Data[InvID] ) )
                    && InvDetailed_Data[InvType] <> ""
                    && NOT ( ISBLANK ( InvDetailed_Data[InvType] ) )
                        && InvDetailed_Data[InvType] <> "Credit Memo"
                        && InvDetailed_Data[InvType] <> "Debit Memo"
                        && InvDetailed_Data[InvProgram] = "WM"
        ),
        DATEADD ( 'Calendar'[Date], -1, MONTH )
    )
RETURN
    COUNTROWS ( DISTINCT ( EXCEPT ( Ids, LastMonthIDs ) ) )

 

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

SU18_powerbi_badge

Anonymous
Not applicable

thanks for reply but results are still same I think except not working . Any other way to write same DAX  or any other solution ?

Anonymous
Not applicable

@AlB 

Current month like month that we select in filter . Pervious month means 1 month previous of slected filter month.

I want to get id's that are not avaliable in previous month.

AlB
Community Champion
Community Champion

Hi @Anonymous 

You need to explain a bit more. What is last month exactly? From when to when?

What period do you want to include exactly for the first part of the EXCEPT? Is it this month? From when to when?

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

 

SU18_powerbi_badge

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.