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
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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.