Forum Discussion
Measurement Time out
- 4 years ago
WaelTalaat79 change your measure to this:
YTD Prog. Rebates Value = VAR _Yearly_Purchases_Value = [Yearly Purchases Value] VAR _slab = [Slab-#] VAR _result = SWITCH( _slab, 0, 0, 1, SUM ( '2022 P-Rebates Slab Condition %'[Slab % 1] ), 2, SUM ( '2022 P-Rebates Slab Condition %'[Slab % 2] ), 3, SUM ( '2022 P-Rebates Slab Condition %'[Slab % 3] ), 4, SUM ( '2022 P-Rebates Slab Condition %'[Slab % 4] ), 5, SUM ( '2022 P-Rebates Slab Condition %'[Slab % 5] ), 6, SUM ( '2022 P-Rebates Slab Condition %'[Slab % 6] ) ) * _Yearly_Purchases_Value RETURN _result - 4 years ago
My Savior 😍
it just 5 seound "OMG , love you man"
ok that is encourge me to ask for mor 2 measure related
i need to get the monthly impacy by sbtruct the current month value - previous month
but when i do it the calcoulation consider the previous month od Jan is DEC. with value but dec. should be zeroPR for PreivMonth =(CALCULATE([YTD PR Calculate],PREVIOUSMONTH('Date'[Date].[Date])))
WaelTalaat79 you can't do anything regarding 2 (maybe if you upgrade to PPU but not sure it will give you more resources). You basically need to work on 1 🙂 A measure should take no more than 1/2 seconds, definitely not 8-10 minutes.
Share the code you wrote.
- WaelTalaat794 years agoHelper Ithe measure below deband on column data from direct source Excel "Slab"
and the Yearly purchases is a column calcoulation to get the purchases from another table sourcestep is to add a Share key to lookup the purchase table into slab tablethe geting data column for 12 month to calcoulate the Yearly Purchases:1- MTD Jan. Pur = CALCULATE(SUM('1- Items purchases Data'[Invoice Amt Without Tax]),FILTER(('1- Items purchases Data'),'1- Items purchases Data'[Key]='2022 P-Rebates Slab Condition %'[Key]),FILTER('1- Items purchases Data','1- Items purchases Data'[Date 1].[Year]=2022),FILTER('1- Items purchases Data','1- Items purchases Data'[Date 1].[MonthNo]=1))"Column " 12- YTD Dec. Pur = [1- MTD Jan. Pur]+[2- MTD Feb. Pur]+[3- MTD Mar. Pur]+[4- MTD apr. Pur]+[5- MTD May Pur]+[6- MTD Jun. Pur]+[7- MTD Jul. Pur]+[8- MTD Aug. Pur]+[9- MTD Sep. Pur]+[10- MTD Oct. Pur]+[11- MTD Nov. Pur]+[12- MTD Dec. Pur]and thenmeasureYTD Prog. Rebates Value = if([Slab-#]=0,0,if([Slab-#]=1,(SUM('2022 P-Rebates Slab Condition %'[Slab % 1])*([Yearly Purchases Value])),if([Slab-#]=2,(SUM('2022 P-Rebates Slab Condition %'[Slab % 2])*([Yearly Purchases Value])),if([Slab-#]=3,(SUM('2022 P-Rebates Slab Condition %'[Slab % 3])*([Yearly Purchases Value])),if([Slab-#]=4,(SUM('2022 P-Rebates Slab Condition %'[Slab % 4])*([Yearly Purchases Value])),if([Slab-#]=5,(SUM('2022 P-Rebates Slab Condition %'[Slab % 5])*([Yearly Purchases Value])),if([Slab-#]=6,(SUM('2022 P-Rebates Slab Condition %'[Slab % 6])*([Yearly Purchases Value])))))))))- SpartaBI4 years agoCommunity Champion
WaelTalaat79 change your measure to this:
YTD Prog. Rebates Value = VAR _Yearly_Purchases_Value = [Yearly Purchases Value] VAR _slab = [Slab-#] VAR _result = SWITCH( _slab, 0, 0, 1, SUM ( '2022 P-Rebates Slab Condition %'[Slab % 1] ), 2, SUM ( '2022 P-Rebates Slab Condition %'[Slab % 2] ), 3, SUM ( '2022 P-Rebates Slab Condition %'[Slab % 3] ), 4, SUM ( '2022 P-Rebates Slab Condition %'[Slab % 4] ), 5, SUM ( '2022 P-Rebates Slab Condition %'[Slab % 5] ), 6, SUM ( '2022 P-Rebates Slab Condition %'[Slab % 6] ) ) * _Yearly_Purchases_Value RETURN _result- WaelTalaat794 years agoHelper I
My Savior 😍
it just 5 seound "OMG , love you man"
ok that is encourge me to ask for mor 2 measure related
i need to get the monthly impacy by sbtruct the current month value - previous month
but when i do it the calcoulation consider the previous month od Jan is DEC. with value but dec. should be zeroPR for PreivMonth =(CALCULATE([YTD PR Calculate],PREVIOUSMONTH('Date'[Date].[Date])))