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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Calculating the sum of a value on the DIM side of a star Schema

Hi all, 

 

Want some general thoughts on the below and optimsing a measure. 

 

Adopting a general star schema model with central FACT followed by DIMS attached. However, i'm interested in calculating the sum of the value in the DIM, specifically Lost time. For note the FACT is an audit table and the Lost time is an aggragation. Introducing the DIM value into the fact table would provide an incorrect result it would multiple the lost time but X number of Rows. 

 

I'm looking to get the aggregation of Lost time in One DIM table, and looking to group by this a variable in a seperate DIM. i.e. lost time in Table X wants to be filters by Group in table Y. 

 

Now to overcome this i've done the following: 

 

CALCULATE(SUM('DIMX'[Business Duration In Seconds]), CROSSFILTER('DIMX'[Sla Instance Id],factY[Sla Instance Id],both))
 
The idea being that you increase the expanded table by including the cross filter (note no applying cross filter in the model due to bad practice). 
 
Overall, is this the only solution? or are there better solutions to the issues? 
 
any thoughts appriciated. 
 
Thanks, 
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi,

Thanks for the solution @Sahir_Maharaj  offered and i want to offer some more information for user to refer to.

hello @Anonymous , based on your description, you want to see the aggregation of Lost time in One DIM table, if you don't want to change the filter direction of the dim table and the fact table to both, when you change the filter direction to both, it will affect the perfoamrnce of the data model, so the crossfilter() funciton is the best option,  the impact would be only when you use that particular measure in a report page, not always, you can refer to the following link.

DAX CrossFilter Function in Power BI: Write the Formula both-directional, but keep the relationship single-directional - RADACAD

Exploring the Power of CROSSFILTER in Power BI | by Andrew Hubbard | Microsoft Power BI | Medium

 

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi,

Thanks for the solution @Sahir_Maharaj  offered and i want to offer some more information for user to refer to.

hello @Anonymous , based on your description, you want to see the aggregation of Lost time in One DIM table, if you don't want to change the filter direction of the dim table and the fact table to both, when you change the filter direction to both, it will affect the perfoamrnce of the data model, so the crossfilter() funciton is the best option,  the impact would be only when you use that particular measure in a report page, not always, you can refer to the following link.

DAX CrossFilter Function in Power BI: Write the Formula both-directional, but keep the relationship single-directional - RADACAD

Exploring the Power of CROSSFILTER in Power BI | by Andrew Hubbard | Microsoft Power BI | Medium

 

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

Anonymous
Not applicable

Hi @Anonymous - Thanks for your input, I thought this may be the case but thought i'd check with the community. 

 

@Sahir_Maharaj - Thank you for your input as well, it was much appriciated. 

 

Thanks both. 

 

Anonymous
Not applicable

Hi @Sahir_Maharaj,

 

The suggestion you've provided wouldn't answer the question in that you're only doing the calculation in the DimX table (The orignal table with lost time). There would be instances where you'd want to filter the lost time aggregation by dimensions in different tables. i.e. DIMA, DIMB, DIMC

 

 

Sahir_Maharaj
Super User
Super User

Hello @Anonymous,

 

Could you please try this approach using a calculated column for grouped aggregation:

DIMX[LostTimeByGroup] = 
CALCULATE(
    SUM(DIMX[Business Duration In Seconds]),
    ALLEXCEPT(DIMX, DIMX[GroupID])
)

Should you require any further assistance, please do not hesitate to reach out to me.


Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution? (Yes, its FREE!)
➤ Lets connect on LinkedIn: Join my network of 15K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ About: https://sahirmaharaj.com/about.html
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
➤ 100+ FREE Power BI Themes: Download Now
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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