Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi All,
I am stuck in the following Dax calculation, hope you could help.
I have two tables
Table 1 has details of a product launch date
Product | Launch date |
Mobile | 09-08-2017 |
Laptop | 01-08-2017 |
Shirt | 08-08-2017 |
Jeans | 04-08-2017 |
Table 2 on Product sale from launch date
Product | Date | Daily Sale |
Mobile | 09-08-2017 | 891 |
Mobile | 10-08-2017 | 599 |
Mobile | 11-08-2017 | 828 |
Mobile | 12-08-2017 | 977 |
Mobile | 13-08-2017 | 521 |
Mobile | 14-08-2017 | 695 |
Laptop | 01-08-2017 | 787 |
Laptop | 02-08-2017 | 646 |
Laptop | 03-08-2017 | 693 |
Laptop | 04-08-2017 | 917 |
Laptop | 05-08-2017 | 781 |
Laptop | 06-08-2017 | 674 |
Laptop | 07-08-2017 | 679 |
Laptop | 08-08-2017 | 998 |
Laptop | 09-08-2017 | 930 |
Laptop | 10-08-2017 | 744 |
Laptop | 11-08-2017 | 859 |
Laptop | 12-08-2017 | 667 |
Laptop | 13-08-2017 | 617 |
Laptop | 14-08-2017 | 844 |
Shirt | 08-08-2017 | 606 |
Shirt | 09-08-2017 | 678 |
Shirt | 10-08-2017 | 772 |
Shirt | 11-08-2017 | 783 |
Shirt | 12-08-2017 | 718 |
Shirt | 13-08-2017 | 793 |
Shirt | 14-08-2017 | 894 |
Jeans | 04-08-2017 | 696 |
Jeans | 05-08-2017 | 765 |
Jeans | 06-08-2017 | 964 |
Jeans | 07-08-2017 | 784 |
Jeans | 08-08-2017 | 869 |
Jeans | 09-08-2017 | 745 |
Jeans | 10-08-2017 | 566 |
Jeans | 11-08-2017 | 765 |
Jeans | 12-08-2017 | 839 |
Jeans | 13-08-2017 | 659 |
Jeans | 14-08-2017 | 875 |
I am trying to find out the sale for each product in the first 3 days from launch.
I have used this formula to calculate
CALCULATE([Total Earning],FILTER(ALL(Table2[Date]),MAX(Table1[Release Date])<=Table2[Date]+3)) something similar to Sumifs we do in normal excel
Request your help
Solved! Go to Solution.
Hi @baronraghu,
I have made a setup of ytou table in wich the tables are related by the Product and added the following measure:
Sales_3 days = VAR date_launch = MAX ( Product_Lauch[Launch date] ) RETURN CALCULATE ( SUM ( Product_Sales[Daily Sale] ), Product_Sales[Date] <= date_launch + 3 )
This gives me the following result:
I have added the launch date in the summary table but you can you your measure direclty in a chart/card/etc.. no need to have the date or any other filter as you can see above.
Regards,
MFelix
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @baronraghu,
I have made a setup of ytou table in wich the tables are related by the Product and added the following measure:
Sales_3 days = VAR date_launch = MAX ( Product_Lauch[Launch date] ) RETURN CALCULATE ( SUM ( Product_Sales[Daily Sale] ), Product_Sales[Date] <= date_launch + 3 )
This gives me the following result:
I have added the launch date in the summary table but you can you your measure direclty in a chart/card/etc.. no need to have the date or any other filter as you can see above.
Regards,
MFelix
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @MFelix
Thanks for your reply.
I was getting this error that Calculate function is returning a true/false value which is not allowed. Is this because I am not using DAX studio and missed out something?
I had written Calculate (sum(table2(daily Sales)),Table2[Date]),Table2<=Max(Table1[Launch date])+2)
I tried using this formula and it worked out for me
Calculate( Sum(Table2(Daily Sale)),Filter(All(Table2[Date]),Table2<=Max(Table1[Launch date])+2)
Regards
Hi @baronraghu,
Great to hear the problem got resolved! Could you accept the corresponding reply as solution to close this thread?
Regards
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
143 | |
85 | |
66 | |
51 | |
45 |
User | Count |
---|---|
216 | |
89 | |
82 | |
66 | |
57 |