Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi All,
I need to add all distinct values of a column based on a filter. I have tried out this formula but it is throughing an error...
formula that i applied:
When you want to do both count and sum both then means there should some group by or level till which you will count post that you will sum. summarize helps you in such case
sumx(summarize(FILTER(SAVINGS,SAVINGS[DATE2]="21-MAY"),SAVING[Some ID],"_dis",DISTINCTCOUNT(SAVINGS,SAVINGS[AMOUNT])),[_dis])
This SAVING[Some ID] can one column or more and can come from one more related table.
Please see an example. Here we wanted to count customer shown growth
Count of Cutomer =
var _date = MAXX(OrderTime,OrderTime[Order Date])
var x= 1
return
CALCULATE(COUNTX(SUMMARIZE(Sales,Sales[Brand],Sales[Customer ID],"ytd",TOTALYTD(sum(Sales[Sales]),'Order'[Order Date],"12/31"),"LYTD",CALCULATE(sum(Sales[Sales]),SAMEPERIODLASTYEAR('Order'[Order Date]))),if([ytd]>[LYTD],Sales[Customer ID])))
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges
Connect on Linkedin
Resolvi um problema parecido, usando a dica do amigo, realizei o calculo do KM rodado de uma viagem.
esse se multiplicava conforme a quantidade de documentos que havia dentro do manifesto, com a seguinte função trouxe apenas uma informação isolada de cada coluna e realizei a soma:
It's very hard to answer such a far ranging question " not only for one table.... suggest me for multiple tables in one query itself."
If you can post some sample data, and also the error that your dax code is throwing, we may be able to make some practical suggestions.
Help when you know. Ask when you don't!
User | Count |
---|---|
47 | |
26 | |
21 | |
17 | |
15 |
User | Count |
---|---|
53 | |
34 | |
17 | |
17 | |
15 |