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