Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi,
I have a measure where it's put into a matrix with employee field added to rows. It works as expected for each row of employee. However, when it comes to the total at the bottom, it shows as blank.
Measure=
VAR _TimeIntelligence=MINX('Time Intelligence','Time Intelligence'[Time Intelligence ID])
Var _Date=EOMONTH(MAX('Calendar'[Date]),0)
Var _LatestDate=MIN(MINX('Employee ID & Name Dim','Employee ID & Name Dim'[Criteria2]),_Date)
Var _MTDStartDate=EOMONTH(_Date,-1)+1
Var _QTDStartDate=DATE(YEAR(_Date),FLOOR(MONTH(_Date)-1,3)+1,1)
Var _YTDStartDate=EOMONTH(_Date,-MONTH(_Date))+1
Var _Sales = SWITCH(_TimeIntelligence,
1,CALCULATE([Sales],'Employee ID & Name Dim'[Criteria1]<>"",'Employee ID & Name Dim'[Termination Date]>_Date,FILTER(ALL('Calendar'),'Calendar'[Date]>=_MTDStartDate&&'Calendar'[Date]<=_LatestDate)),
2,CALCULATE([Sales],'Employee ID & Name Dim'[Criteria1]<>"",'Employee ID & Name Dim'[Termination Date]>_Date,FILTER(ALL('Calendar'),'Calendar'[Date]>=_QTDStartDate&&'Calendar'[Date]<=_LatestDate)),
3,CALCULATE([Sales],'Employee ID & Name Dim'[Criteria1]<>"",'Employee ID & Name Dim'[Termination Date]>_Date,FILTER(ALL('Calendar'),'Calendar'[Date]>=_YTDStartDate&&'Calendar'[Date]<=_LatestDate))
)
Return _Sales
How can i fix it so that total shows correctly?
Hi @loafers ,
You can then create a new measure to be placed on the matrix visual object instead of the measure.
Measure=
VAR _TimeIntelligence=MINX('Time Intelligence','Time Intelligence'[Time Intelligence ID])
Var _Date=EOMONTH(MAX('Calendar'[Date]),0)
Var _LatestDate=MIN(MINX('Employee ID & Name Dim','Employee ID & Name Dim'[Criteria2]),_Date)
Var _MTDStartDate=EOMONTH(_Date,-1)+1
Var _QTDStartDate=DATE(YEAR(_Date),FLOOR(MONTH(_Date)-1,3)+1,1)
Var _YTDStartDate=EOMONTH(_Date,-MONTH(_Date))+1
Var _Sales = SWITCH(_TimeIntelligence,
1,CALCULATE([Sales],'Employee ID & Name Dim'[Criteria1]<>"",'Employee ID & Name Dim'[Termination Date]>_Date,FILTER(ALL('Calendar'),'Calendar'[Date]>=_MTDStartDate&&'Calendar'[Date]<=_LatestDate)),
2,CALCULATE([Sales],'Employee ID & Name Dim'[Criteria1]<>"",'Employee ID & Name Dim'[Termination Date]>_Date,FILTER(ALL('Calendar'),'Calendar'[Date]>=_QTDStartDate&&'Calendar'[Date]<=_LatestDate)),
3,CALCULATE([Sales],'Employee ID & Name Dim'[Criteria1]<>"",'Employee ID & Name Dim'[Termination Date]>_Date,FILTER(ALL('Calendar'),'Calendar'[Date]>=_YTDStartDate&&'Calendar'[Date]<=_LatestDate))
)
Return _Sales
New measure=SUMX(VALUES('Table'[employee]),[Measure])
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
80 | |
79 | |
59 | |
36 | |
35 |
User | Count |
---|---|
99 | |
57 | |
56 | |
46 | |
40 |