March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
this is my pbix file : https://1drv.ms/u/s!Ag9tIyk2ofNRjk7ex9NVCSWmzVF9?e=hzuIkt
i have this measure:
Expenses =
var NEWtotalrevenue = CALCULATE(SUM(Revenue[Total]),FILTER('Calendar','Calendar'[Date] >= DATE(2022,10,3)))
VAR OLDtotalrevenue = CALCULATE(SUMX(Revenue,Revenue[Amount]*Revenue[Qtty]),FILTER('Calendar','Calendar'[Date] < DATE(2022,10,3)))
VAR totalrevenue = OLDtotalrevenue + NEWtotalrevenue
Var newsalesmanrevenue = CALCULATE(SUM(Revenue[Total]),FILTER('Calendar','Calendar'[Date] >= DATE(2022,10,3)),Revenue[Salesman]="A")
VAR Oldsalesmanrevenue = CALCULATE(SUMX(Revenue,Revenue[Amount]*Revenue[Qtty]),FILTER('Calendar','Calendar'[Date] < DATE(2022,10,3)),Revenue[Salesman]="A")
VAR salesmanrevenue = Oldsalesmanrevenue + newsalesmanrevenue
VAR percentage = salesmanrevenue/totalrevenue
var expenses = SUM(Expense[Total])
return
expenses*percentage
those are the pictures:
expense table:
revenue table:
week 40 :
week 41:
both selected weeks:
as you see expense on both selected dates is 801.01
but if you manually add week 40 and week 41,
i get 365.30 + 431.27 = 796.57
any help is appreciated
@Jihwan_Kim
Solved! Go to Solution.
Hi,
I am not sure if I understood the question correctly, but please try the below measure whether it suits your requirement.
Expenses V2 =
VAR _newtable =
ADDCOLUMNS (
DISTINCT ( 'Calendar'[Week of Year] ),
"@percentage", [Percentage V2],
"@expensetotal", CALCULATE ( SUM ( Expense[Total] ) )
)
RETURN
SUMX ( _newtable, [@percentage] * [@expensetotal] )
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Hi,
I am not sure if I understood the question correctly, but please try the below measure whether it suits your requirement.
Expenses V2 =
VAR _newtable =
ADDCOLUMNS (
DISTINCT ( 'Calendar'[Week of Year] ),
"@percentage", [Percentage V2],
"@expensetotal", CALCULATE ( SUM ( Expense[Total] ) )
)
RETURN
SUMX ( _newtable, [@percentage] * [@expensetotal] )
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Youre a life saver thank you
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
25 | |
18 | |
15 | |
9 | |
8 |
User | Count |
---|---|
37 | |
32 | |
21 | |
16 | |
14 |