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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
WaelTalaat79
Helper I
Helper I

Measurement Time out

Dears,

the below highlited calcoulation takes long time to proceed the result in Power BI disktop around 8-10 min

1.JPG

but when i publish the pbix to the Pro user on servier

it show me the below screen shot

2.JPG

3.JPG

So my Question is
1- how to speed up the calcoulation proccess of measurement?
2- How to solve the time out issue in server?

 

2 ACCEPTED SOLUTIONS

@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

 

 

 




2022-05-19 17_30_22-Re_ Need help on DAX function with measure vs colu... - Microsoft Power BI Commu.png

Showcase Report – Contoso By SpartaBI


SpartaBI_3-1652115470761.png   SpartaBI_1-1652115142093.png   SpartaBI_2-1652115154505.png

Full-Logo11.png

View solution in original post

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])))
1.JPG

 

View solution in original post

5 REPLIES 5
SpartaBI
Community Champion
Community Champion

@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.

the 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 source
 
step is to add a Share key to lookup the purchase table into slab table
the 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 then
 measure 
YTD 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])))))))))

@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

 

 

 




2022-05-19 17_30_22-Re_ Need help on DAX function with measure vs colu... - Microsoft Power BI Commu.png

Showcase Report – Contoso By SpartaBI


SpartaBI_3-1652115470761.png   SpartaBI_1-1652115142093.png   SpartaBI_2-1652115154505.png

Full-Logo11.png

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])))
1.JPG

 

@WaelTalaat79 my pleasure my friend 🙂
For community visabilty better to open a new thread per question, so open a new one and I'll try to get to it. Need to leave PC for now

And hey, check out my showcase report:
https://community.powerbi.com/t5/Data-Stories-Gallery/SpartaBI-Feat-Contoso-100K/td-p/2449543
Give it a thumbs up if you liked it 🙂

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors