Forum Discussion

WaelTalaat79's avatar
WaelTalaat79
Helper I
4 years ago
Solved

Measurement Time out

Dears, the below highlited calcoulation takes long time to proceed the result in Power BI disktop around 8-10 min but when i publish the pbix to the Pro user on servier it show me the below ...
  • SpartaBI's avatar
    SpartaBI
    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

     

     

     




    Showcase Report – Contoso By SpartaBI


          

  • WaelTalaat79's avatar
    WaelTalaat79
    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 zero

    PR for PreivMonth =
    (CALCULATE([YTD PR Calculate],PREVIOUSMONTH('Date'[Date].[Date])))