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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Th0mc
Frequent Visitor

How to show a Target in a Matrix

Hi all,

 

I'm trying to show a Target inside a Matrix visual without success.

To keep it simple, here is what I have :

- one dimension table with 'Domains', one with a subdivion 'SubDomain'

- one fact table with the target by domain by month

DomainMonthValue
Domain1January

1000

.........
Domain1December900
Domain2January2000
...  
Domain2December2200
etc.  

- one fact table with projects costs

DomainSubDomainProjectCost Category1Cost Category2Cost
Domain1SubDomain1Project1Software CostEE100
Domain1SubDomain1Project1InternalNA200
...     

- Relations between tables :

- DimDomain 1-* FactTargets

- DimDomain 1-* DimSubDomain 1-* FactProjectCosts

 

My goal is to add in an existing Matrix the target of the last month in a column :

DomainCost Category 1 Value1Cost Category 1 Value2TotalTarget
Domain1xxxxxxxx 900
Domain2xxxxxxxx 2200

 

When I try to add the target to the Matrix, I always have the sum of all the targets for all the months, all the domains for each domain 😞

 

Thanks in advance

Thomas

4 REPLIES 4
v-yadongf-msft
Community Support
Community Support

Hi @Th0mc ,

 

If you want to get the total amount of target, please try:

CALCULATE(MAX('FactDomainTarget'[Value]),FILTER('FactDomainTarget', MONTH('FactDomainTarget'[Month] = 12))

 As for the first question, please provide more details.

 

Best regards,

Yadong Fang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

v-yadongf-msft
Community Support
Community Support

Hi @Th0mc ,

 

Please try following DAX:

Target = IF(ISINSCOPE('Table1'[Domain]),CALCULATE(MAX('Table1'[Value]),FILTER('Table1','Table1'[Month] = "December")),BLANK())

 

vyadongfmsft_0-1664258733152.png

 

Best regards,

Yadong Fang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks Yadong

It is much better!

But I still have some requirements 😉

 

Following your recommandation, I used the following formulae :

 

Target = IF(ISINSCOPE('DimDomain'[Domain]),CALCULATE(MAX('FactDomainTarget'[Value]),FILTER('FactDomainTarget', MONTH('FactDomainTarget'[Month] = 12)),BLANK())

 

That seems to work fine. thanks again.

 

But then, if I add it as a value in the Matrix, I get fro example :

DomainCostCategory1 Value1TargetCostCategory1 Value 2Targetetc.... 
Domain1 Target for Domain1 Target for Domain1  
....      
       
TotalTotal of value<Blank>Total of value<Blank>  

 

--> Target value is repeated for Cost Category value whereas I would need to see Target only once

--> The total of Target, at the end the first thing we are looking at, is missing

 

Any way to achieve to get only one column with the target and get the total amount of target.

 

thanks again

Thomas

Greg_Deckler
Community Champion
Community Champion

@Th0mc Should be something along the lines of:

Measure =
  VAR __Domain = MAX('Table'[Domain]
  VAR __Date = MAX('Table'[Date])
  VAR __LMDate = EOMONTH(__Date,-1)
  VAR __LM = FORMAT(__LMDate,"mmmm")
  VAR __LMYear = YEAR(__LMDate)
  VAR __Table = FILTER(ALL('Table'),[Domain] = __Domain && [Month] = __LM && [Year] = __LMYear)
RETURN
  MAXX(__Table,[Value])


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...

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors