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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
TRADER083
Helper I
Helper I

Overriding filter context and duplicate measure value

Hi everyone, the title probably does not accurately describe the problem but I hope the following example can. I have a measure [M_test sum] that sums the values based on the Attribute column using an inactive relationship (may/may not be relevant here). Attribute 2 always returns blank because the fact table only has attributes 1, 3, 4, 5. I would like this measure use Attribute 1 as the filter to sum Attibute 2, essentially replicating the sum of Attribute 1 (see Proposed below). The reason why this is needed is because the [Sum of Value] column will have different values for Attribute 1 and 2 which is sourced from a different table. [Sum of Value] and [M_test sum] will be compared against each other.

 

Current:

Table.png

Proposed:

Table.png

EDIT: The found a costly workaround which is to create a calculated column in the fact table that converts all Attribute 1 to 2 and create a measure (and a new inactive relationship) that sums this new column. Finally, sum the 2 measures to get desired results. Still prefer a solution that doesn't introduce calculated columns in the fact table.

 Table2.png

2 REPLIES 2
amitchandak
Super User
Super User

@TRADER083 , Try a measure like , Asuuming you have a meausre [M Test Sum]

 

 

if(not(isblank([M Test Sum]) ), [M Test Sum],
CALCULATE([M Test Sum],OFFSET(-1, ALL('Table'[Attributr]),ORDERBY('Table'[Attributr]))) )

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Thank you. It looks promising but I couldn't get to work properly. It may be because Attribute 2 only exists in the dimension table and not in the fact table. The measure will offset (-1) the values from Attibute 1 to 3 instead from 1 to 2.

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.