March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
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
Solved! Go to Solution.
Hi @reynaldo_malave ,
I can't reproduce your problem, your formula works correctly in my example data. Could you please share some example data?
Best Regards,
Winniz
Hi @reynaldo_malave ,
I can't reproduce your problem, your formula works correctly in my example data. Could you please share some example data?
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
@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))
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
21 | |
14 | |
11 | |
8 | |
5 |
User | Count |
---|---|
26 | |
21 | |
20 | |
14 | |
10 |