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 have 2 excel files.
The first one shows the list of quantity demanded for each item by month.
The second one shows the last possible sale date for each item. (There can be no quantity demanded after the specified last sales date. )
How can I create a calculation to show how much quantity for each item is being demanded after the specified last sales date?
(I'm having troubles because the last sale date is unique to each item)
Thank you
Solved! Go to Solution.
Hi,
Build a relationship from the Item column of Table1 to the Item column of Table2. In your visual, drag the Item column from Table2. Write these measures
Last date = MAX(Table2[Last sale date])
Quantity sold beyond the last sale date = if(HASONEVALUE(Table2[Item]),CALCULATE(SUM(Table1[Quantity]),FILTER(VALUES(Table1[Plan]),Table1[Plan]>[Last date])),SUMX(SUMMARIZE(VALUES(Table2[Item]),[Item],"ABCD",CALCULATE(SUM(Table1[Quantity]),FILTER(VALUES(Table1[Plan]),Table1[Plan]>[Last date]))),[ABCD]))
Hope this helps.
Table 1 has date item number, quantity demanded per month. Table 2 has the Item and the Last Sale Date.
I want to create a CALCULATION, where I can see the quantity demanded that is past the last sale date per item.
Hi,
Build a relationship from the Item column of Table1 to the Item column of Table2. In your visual, drag the Item column from Table2. Write these measures
Last date = MAX(Table2[Last sale date])
Quantity sold beyond the last sale date = if(HASONEVALUE(Table2[Item]),CALCULATE(SUM(Table1[Quantity]),FILTER(VALUES(Table1[Plan]),Table1[Plan]>[Last date])),SUMX(SUMMARIZE(VALUES(Table2[Item]),[Item],"ABCD",CALCULATE(SUM(Table1[Quantity]),FILTER(VALUES(Table1[Plan]),Table1[Plan]>[Last date]))),[ABCD]))
Hope this helps.
Thank you for the reply!
I tried this and have gotten the error, "Too many arguments were passed to the HASONEVALUE function. The maximum argument count for the funciton is 1".
Hi,
Check your brackets
HI @PBIUWO
Could you please post sample data with expected output? This will help us to help you.
Thanks
Raj
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 |
---|---|
107 | |
96 | |
77 | |
66 | |
53 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |