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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
reynaldo_malave
Helper III
Helper III

Measure Does Not Return Accurate Total

Hi Guys,

 

I am trying to understand what is am doing wrong. I am sure this is a rookie mistake but I cant really see it. The measures is retreiving the total tickets from my sales table as a distinctcount by operation type. This means its counting sales and returns then substracts and gives back the total. If I add a filter context it shows the correct answer the problem is at the total level. 😞

 

# Total Tickets = 

var TicketsSales =

CALCULATE(
    DISTINCTCOUNT( Sales[TicketNumber] ),
    Ventas[OperationType] = 1
)        

 var TicketsReturns =

CALCULATE(
    DISTINCTCOUNT( Sales[TicketNumber] ),
    Ventas[OperationType] = 2
) 
return TicketsSales -  TicketsReturns

 

Thanks,

 

Reynaldo

 

1 ACCEPTED SOLUTION
v-kkf-msft
Community Support
Community Support

Hi @reynaldo_malave ,

 

I can't reproduce your problem, your formula works correctly in my example data. Could you please share some example data?

 

vkkfmsft_1-1652689243515.png

 

Best Regards,
Winniz

View solution in original post

3 REPLIES 3
v-kkf-msft
Community Support
Community Support

Hi @reynaldo_malave ,

 

I can't reproduce your problem, your formula works correctly in my example data. Could you please share some example data?

 

vkkfmsft_1-1652689243515.png

 

Best Regards,
Winniz

Hi @amitchandak and @v-kkf-msft ,

 

Thank you both for your replies. After taking a closer look at my numbers I found out it is working properly its just after all slicing and dicing on a matrix total become a little confusing.

 

Once again thanks,

 

Reynaldo

amitchandak
Super User
Super User

@reynaldo_malave , distinct count can be different at grand total level, and because it is recalculated you see a difference

 

You can force a row context column in return

example

return Sumx(values(Sales[Column]), calculate(TicketsSales - TicketsReturns))

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

Check out the October 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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