Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
46 | |
26 | |
22 | |
12 | |
8 |
User | Count |
---|---|
73 | |
51 | |
45 | |
16 | |
12 |