Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Anonymous
Not applicable

Total sum of a daily measure

I'm currently working on inventory reconciliation, and used this measure to calculate the amount of $s(product) we're holding by day:

Inventory = CALCULATE(SUM(ledger[cost]),
                      FILTER(ALL(DimDate[Date]),
                             DimDate[Date]<=MAX(DimDate[Date])))

Also, we get charged a fee based upon the amount dollars we're holding by day:

Fee = (0.03/365)*[Inventory]

This how a sample looks like:

 

DateInventoryFee
1/1/2020 0:00$15,912.00$1.31
1/2/2020 0:00$14,976.00$1.23
1/3/2020 0:00$7,020.00$0.58
1/4/2020 0:00$7,020.00$0.58
1/5/2020 0:00$7,020.00$0.58
1/6/2020 0:00$3,276.00$0.27
1/7/2020 0:00$3,276.00$0.27
1/8/2020 0:00$1,404.00$0.12
1/9/2020 0:00$1,404.00$0.12
 

I've been trying to create another measure, which is going to be the total sum of the fee but so far I've been successful.

Thank you!

1 ACCEPTED SOLUTION
PaulDBrown
Community Champion
Community Champion

@Anonymous 

 

Try:

Sum of fee = SUMX(DimDate, [fee])




Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

7 REPLIES 7
v-alq-msft
Community Support
Community Support

Hi, @Anonymous 

 

If you take the answer of someone, please mark it as the solution to help the other members who have same problems find it more quickly. If not, let me know and I'll try to help you further. Thanks.

 

Best Regards

Allan

Anonymous
Not applicable

Hi Allan,

it's done

v-alq-msft
Community Support
Community Support

Hi, @Anonymous 

 

Based on your description, I created data to reproduce your scenario.

ledger:

c1.png

DimDae(a calculated table):

DimDate = CALENDARAUTO()

 

You may create measures as follows.

Inventory = 
IF(
    MAX(ledger[date])<>BLANK(),
    CALCULATE(
        SUM(ledger[cost]),
        FILTER(
            ALL(DimDate[Date]),
            DimDate[Date]<=MAX(DimDate[Date])
        )
    )
)

Fee = 
SUMX(
    ledger,
    (0.03/365)*[Inventory]
)

 

Finally you may use a table visual or a card visual to display the result.

c2.png

 

Best Regards

Allan

 

If this post helps, then please consider Accepting it as the solution.

amitchandak
Super User
Super User

Try

Fee Sum= SUMX(all(DimDate), [fee])

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
In case it does not help, please provide additional information and mark me with @

Thanks. My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Connect on Linkedin

Anonymous
Not applicable

Thank you! 

PaulDBrown
Community Champion
Community Champion

@Anonymous 

 

Try:

Sum of fee = SUMX(DimDate, [fee])




Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Anonymous
Not applicable

thank you! 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.