Forum Discussion
[HELP] How to create my first DAX
- 9 years ago
In general:
Measure = CALCULATE(COUNT(Table[Column]),FILTER(Table,[DISCOUNT] > 0))
- 9 years ago
Try putting the table name in front of the second column. You'll definitely need to have all of the tables related to one another. Posting some sample/mock data would be very beneficial to posting a solution that would definitely work. You can also look into RELATED and RELATEDTABLE functions. For example, you could do things like:
Measure = CALCULATE(COUNT(Table[Column]),FILTER(Table[DISCOUNT] > 0), FILTER(RELATEDTABLE(Table2), [Item_Sold] > 0))
smoupre,
Thank you for the quick response, I will try what you suggested, but DISCOUNT is on the TABLE PRODUCTS_PRICES and Item_Sold is on the TABLE SOLD_ITEMS the way you suggesting DISCOUNT and Item_Sold had to be on the same table no ?
Edit:
As I imagined, it doesnt work, it says that the colum Item_Sold was not found. If you could suggest how to do it would be great.
Thx
Try putting the table name in front of the second column. You'll definitely need to have all of the tables related to one another. Posting some sample/mock data would be very beneficial to posting a solution that would definitely work. You can also look into RELATED and RELATEDTABLE functions. For example, you could do things like:
Measure = CALCULATE(COUNT(Table[Column]),FILTER(Table[DISCOUNT] > 0), FILTER(RELATEDTABLE(Table2), [Item_Sold] > 0))
- tiago9 years ago
Helper I
Smoupre,
Thank you for the reply, definitely will study DAX, but your help was a great start to understand the language. Apparently you last suggestion worked.
Regards,
Tiago