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! Request now

Reply
Ally87
New Member

total in matrix for distinct count is not correct

hello,

this is my matrix and for the Total Work the total is not correct.

Ally87_0-1699529369174.png

these are the dax codes used:

Aggr_Opp_Count = DISTINCTCOUNT(Sales[HPE_Opportunity_Id])
 
Work Load =
VAR KPI_Workload_1 =CALCULATE([Aggr_Opp_Count],Sales[Source_Table]=2&&Sales[Snap_Flag_2]=5&&Sales[Sales_Stage_Flag 2] IN {1,2,3,4,5,6},USERELATIONSHIP(Sales[Fiscal_Quarter_Start_Date],Date_Dim[CLDR_DT]))  
VAR KPI_Workload_2 =CALCULATE([Aggr_Opp_Count],Sales[Source_Table]=2&&Sales[Snap_Flag_2]=5&&Sales[Sales_Stage_Flag 2] IN {7,9,10}&&Sales[Active_Current_Flag]="Y",USERELATIONSHIP(Sales[Fiscal_Quarter_Start_Date],Date_Dim[CLDR_DT]))
Return KPI_Workload_1+KPI_Workload_2
 
Could anyone help me in this matter? 
2 REPLIES 2
Anonymous
Not applicable

Hi @Ally87 ,

Have you solved your problem? It's hard to tell exactly what the problem is based on your screenshots and DAX alone.
If you haven't solved your problem, please provide the pbix file at your convenience. If it's not convenient, please provide a bit of sample data and the data table structure, as well as the table-to-table relationships, that would be helpful.

Best Regards,
Dino Tao

OguzMavice
Resolver II
Resolver II

Hi @Ally87 ,  

 

I think so because of the formulation -> Aggr_Opp_Count = DISTINCTCOUNT(Sales[HPE_Opportunity_Id])

 

It retrieves unique values for each dates. But for the total, again formula retrieve unique values all table. That means, there is an intersection  on your data concerning your condition. You used "userrelationship", could you please control dates on third table (Sales[Fiscal_Quarter_Start_Date]) to detect whether intersection among condition 1 and condition 2 ? looking for a kind of duplication. 

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.