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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
keny999
Regular Visitor

Slow calculate column measure

Hi,

i've got some measure that calculate cummulative of [Plan_Ilość], and it's in the calculate column but it is very slow, how can I do that it can be faster ?:

=

var _Rok_mc = Plan_prod_TTL_etap_0[Rok_m-c_2]

var _Kod = Plan_prod_TTL_etap_0[Kod_produktu]

return

CALCULATE(SUM(Plan_prod_TTL_etap_0[Plan_Ilość]);

KEEPFILTERS(

FILTER(

Plan_prod_TTL_etap_0;_Rok_mc>=Plan_prod_TTL_etap_0[Rok_m-c_2]
&&
_Kod=Plan_prod_TTL_etap_0[Kod_produktu])
);Plan_prod_TTL_etap_0)

5 REPLIES 5
keny999
Regular Visitor

Still very slow, nothing change and how can I put two or more conditions ?

Hi,

If the calculation is still very slow I suspect that the problem lies elsewhere. There are multiple way to optimize a model and it is hard to explain them here. For now I recommend checking your visuals using the built in  report analyzer or using tool like DAX studio or BPA analyzer in tabular editor.

ValtteriN_0-1643373686549.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




I'm in the power pivot and have about 7 000 rows and when wrote the measure I'm waiting and waiting....:

keny999_0-1643373845829.png

 

Hi @keny999 ,

 

I think that your large amount of data and the complexity of the model are causing the calculated column to run slowly, please try to optimize the model. Data reduction techniques for Import modeling 

 

Also, according to the documentation, it is recommended that you create custom columns in Power Query (defined in M) instead of using DAX to create calculated columns, which will improve compression efficiency and reduce refresh time.

 

Best Regards,
Winniz

ValtteriN
Super User
Super User

Hi,

For running total I recommend this pattern:

Period RT =
VAR MaxDate = MAX ( 'Calendar'[Date] )
RETURN
CALCULATE (
SUM(Cumulativetotal[Value]),
'Calendar example'[Date] <= MaxDate,
ALL( 'Calendar' ) )


Also check this article by SQLBI about the topic:
https://www.sqlbi.com/articles/computing-running-totals-in-dax/


I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!






Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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