crossjoin union filter
2 TopicsCreate a virtual table in Dax to calculate account balance for products with different expiry dates
I have product A, B, C. They each have opening balance amount at 1/11/2023 ,say 3000, 7000 and 11000 for A,B,C respectively. They each have expiry dates, say A, B and C expires on 11/11/2023, 5/11/2023 and 30/11/2023 respectively. The opening balance needs to be calculated each month until the expiry dates for the product, i.e. from 1/11 to 5/11, the total opening balance will be 21000 (for all the 3 products) and from 6/11 to 11/11, the total opening balance will be 14000 (3000+11000 for A and C as B has expired) and from 12 to 30/11, the total opening balance will be 11000 (for C only) as both A and B have expired. Is there a way to create a single measure through creation of virtual table or others to achieve this outcome. I tried the following codes but it didn't work: Calculated opening balance test= var latestdate=min(Dim_Date[Date ID]) var latestexpirydate=min(Dim_Expiry_Date[Expiry Date]) var datetable=filter(CROSSJOIN(all(Dim_Date),Dim_Expiry_Date),latestdate<=latestexpirydate) return sumx(datetable,sum(Fact_Account_Opening_Balance[Amount])) Please find below the link to the sample PBI report. Appreciate some experts can help with the dax!! Thank you in advance! Product account balance PBI report Opening balance Date ID Account Code Product Code Amount 1/11/2023 1001 A 1000 1/11/2023 1002 A 2000 1/11/2023 1001 B 3000 1/11/2023 1002 B 4000 1/11/2023 1001 C 5000 1/11/2023 1002 C 6000 Expiry date Product Code Expiry Date A 11/11/2023 B 5/11/2023 C 30/11/2023 Desired output Date ID A B C Total 1/11/2023 3000 7000 11000 21000 2/11/2023 3000 7000 11000 21000 3/11/2023 3000 7000 11000 21000 4/11/2023 3000 7000 11000 21000 5/11/2023 3000 7000 11000 21000 6/11/2023 3000 0 11000 14000 7/11/2023 3000 0 11000 14000 8/11/2023 3000 0 11000 14000 9/11/2023 3000 0 11000 14000 10/11/2023 3000 0 11000 14000 11/11/2023 3000 0 11000 14000 12/11/2023 0 0 11000 11000 13/11/2023 0 0 11000 11000 14/11/2023 0 0 11000 11000 15/11/2023 0 0 11000 11000 16/11/2023 0 0 11000 11000 17/11/2023 0 0 11000 11000 18/11/2023 0 0 11000 11000 19/11/2023 0 0 11000 11000 20/11/2023 0 0 11000 11000 21/11/2023 0 0 11000 11000 22/11/2023 0 0 11000 11000 23/11/2023 0 0 11000 11000 24/11/2023 0 0 11000 11000 25/11/2023 0 0 11000 11000 26/11/2023 0 0 11000 11000 27/11/2023 0 0 11000 11000 28/11/2023 0 0 11000 11000 29/11/2023 0 0 11000 11000 30/11/2023 0 0 11000 11000Solved1.3KViews0likes3CommentsGenerate Custom Table of DATES and CROSSJOIN
Hello everyone, I need a PBI expert's help. Please refer to the table I've copied over. I need to generate a table of custom dates and information. Essentially using this table, I need DAX to generate a table/list of all Mondays [DDD] from the 1st week of the month [Month_Week_Num] for the given timeframe [Block Effective Start Date] - [Block Effective End Date] for each of the [Surgeons] which I've blinded. I think it's a matter of using a combination of FILTER CROSSJOIN UNION, etc but I can't seem to get it to work. For instance, just looking at Surgeon 1, the table should look like: 1/3 Mon Surgeon A 2/7 Mon Surgeon A 3/7 Mon Surgeon A 4/4 Mon Surgeon A 5/2 Mon Surgeon A 6/6 Mon Surgeon A 1/3 Mon Surgeon B 2/7 Mon Surgeon B 3/7 Mon Surgeon B 4/4 Mon Surgeon B 5/2 Mon Surgeon B 6/6 Mon Surgeon B Any help would be appreciated.Solved2.4KViews0likes9Comments