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
GabFort
New Member

DAX Measure is giving same result for each matrix row.

I have tried making a measure to calculate my net new clients from the last month (outputing a 1 if the earliest open date was within the month preceding the month selected in a slicer). Here is my current dax measure 

DYNAMIC Client net new = 
VAR SelectedDate = MAX(dimCalendar[Date])
VAR YearSelected = YEAR(SelectedDate)
VAR MonthSelected = MONTH(SelectedDate)
VAR StartOfLastMonth = IF(
    MonthSelected = 1,
    DATE(YearSelected - 1, 12, 1),
    EOMONTH(SelectedDate, -2) + 1
)
VAR EndOfLastMonth = IF(
    MonthSelected = 1,
    EOMONTH(DATE(YearSelected - 1, 12, 1), 0),
    EOMONTH(SelectedDate, -1)
)

RETURN
IF(
    NOT ISBLANK(SelectedDate),
    SUMX(
        FILTER(
            dimCurrentMatter,
            CONTAINSSTRING(dimCurrentMatter[MatterNumber], "00001") &&
            dimCurrentMatter[OpenDate] >= StartOfLastMonth &&
            dimCurrentMatter[OpenDate] <= EndOfLastMonth &&
            YEAR(dimCurrentMatter[OpenDate]) = if(MonthSelected=1,YEAR(TODAY())-1, YEAR(TODAY()))
        ),
        1
    ),
    BLANK()
)

 

It is giving me the accurate number but when I try to add the measure to a matrix, it gives the exact same number for each row and a total of the same number as well. I tried using the summarize function, addcoluns instead of sumx, calculate, etc. I can get the accurate number multiple different ways but it never sticks when in a visual. 

GabFort_0-1730136315720.png

 



1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@GabFort So typically this indicates a missing relationship between 2 tables. 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

4 REPLIES 4
Greg_Deckler
Community Champion
Community Champion

@GabFort So typically this indicates a missing relationship between 2 tables. 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Is there a way to workaround that at all ? I'm working with a dataset I cannot change and there is indeed not a direct relationship between the table where the opendate is found and the table where the office is found. 

@GabFort Possibly. You could grab the MAX of the office or office ID or whatever. You would need something in your fact table that specified what office was involved. You would then add an additional clause to your FILTER statement ( && ). 

 

That's about as specific as I can get without more information.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Fair ! I cannot add anything to the fact tables used in the model so will need to speak to the model owner before making further progress. Thank you for your answer.

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!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.