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!
I'm quite newbie to PowerBI/PowerPivot/DAX syntax, so I'm sorry if I'm asking for help with a trivial task... that said, let me try to explain the problem I'm facing:
I have the following tables with the respective columns:
and I need to calculate how many occurrences in "tabEVENTOS" table have "tempo" equal to or less than the "target" (from "tabTARGET" table), based on "tipoMov" and "produto" columns. Here is a diagram of the relationship between the tables:
I don't even know where to start solving. I "googled" for more than two hours but I didn't find anything that could clearly help me ... Of course, I found some complex solutions, but none that seemed to be best practices ... Please, can someone help me?
thanks in advance!
Solved! Go to Solution.
I've found a way to achieve it... But I don't know if its the best way to do It...
measure=SUMX(tabEVENTOS; (CALCULATE( MAX(tabTARGET[target]); FILTER(tabTARGET; tabEVENTOS[tipoMov]=tabTARGET[tipoMov]); FILTER(tabTARGET; RELATED(tabPRODUTOS[classeProduto])=tabTARGET[classeProduto]) )>=tabEVENTOS[tempo])*1)
By the way, I apologise about my problem explanation... I think it wasn't clear enough.
the best I can get
countx(filter(summarize(tabEVENTOS, tabMOVS[tabMOV], tabCLASSES[classProduto],"_1"sum(tabEVENTOS[tempo]),"_2",sum(table[target])),[_1]<[_2]),[tabMOV])
I've found a way to achieve it... But I don't know if its the best way to do It...
measure=SUMX(tabEVENTOS; (CALCULATE( MAX(tabTARGET[target]); FILTER(tabTARGET; tabEVENTOS[tipoMov]=tabTARGET[tipoMov]); FILTER(tabTARGET; RELATED(tabPRODUTOS[classeProduto])=tabTARGET[classeProduto]) )>=tabEVENTOS[tempo])*1)
By the way, I apologise about my problem explanation... I think it wasn't clear enough.
Hi @GabrielPires ,
So, have the issue been resolved? If Yes, you may accept the right reply as solution, that way, other community members would benefit from the solution.
Best Regards,
Amy
@amitchandak, thanks for responding!
So, that "string" should be used as a Measure. Right? And should it count how many events were less (or equal) than "target" depending on its "classeProduto" and "tipoMov" as result? And if I "slice" my data by "produto" (for example) that measure should show me the count o ocurrences only on thar category?
I'm asking this because it didn't work... so I'm trying to figure out how to make it work and that is the result I'm looking for.
Wouldn't be easier to calculate a column wich returns 1 or 0 wether my "tempo" clumn satisfy that "<='target' " condition and than sum it?
thanks in advance!
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 |
---|---|
96 | |
94 | |
82 | |
70 | |
64 |
User | Count |
---|---|
116 | |
106 | |
94 | |
79 | |
72 |