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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

SUMX of dimension, exclude fact rows with no related marketvalue

Hi all,

I'm performing a sumx over a dimension table.

For each iteration in the SUMX I need to validate if the SUM of the marketvalue_exporuse in for that Secitity_ID, the Fact_MeasuresESG is not blank or zero. 

It seems simple, but my only sulution for now is to enable a crossfilter between Dim_Security and FactMeasureseESG, in that way the marketvalue can filter the empty CarbonEmissions_TperUSD.

This doesnt feel performant or logical, can anyone guide me in the right direction?

RemyBosman_1-1645706977429.png

 

 

4 REPLIES 4
Anonymous
Not applicable

Hi  @Anonymous ,

You can replace the inner part with Var, such as the following form:

Measure =
var _CATEGORY_VALUES=
VALUES('Transformatie Dim_Security'[Dim_Security_ID])
VAR _SumCarbonEmissions_TperUSD=
CALCULATE(SUM('Transfomate Fact_MeasureESG'[CarbonEmissions_TperUSD]))
VAR _SumMarketValue_ReportingCurrency=
CALCULATE(
    SUM('Transformate Fact_MarketValue_Exposure'[MarketValue_ReportingCurrency]),
    'Transfomate Fact_MeasureESG'[CarbonEmissions_TperUSD]<>BLANK() || 'Transfomate Fact_MeasureESG'[CarbonEmissions_TperUSD] >0)
return
CALCULATE(
    DIVIDE(
        SUMX(
            _CATEGORY_VALUES,
            _SumCarbonEmissions_TperUSD * _SumMarketValue_ReportingCurrency),
         SUMX(
             _CATEGORY_VALUES,
             _SumMarketValue_ReportingCurrency)),
             CROSSFILTER('Transformatie Dim_Security'[Dim_Security_ID],'Transfomate Fact_MeasureESG'[Dim_Security_ID],Both))  

 

Best Regards,

Liu Yang

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

Russell-PBI
Resolver II
Resolver II

Hi @Anonymous, can you show us the DAX for how you're solving it using a crossfilter as it might help us to better understand what you're trying to achieve?

Anonymous
Not applicable

 

Here's my DAX, it is the crossfilter which seems inefficient. Also filtering twice in seperate SUMX's seems too much. 

 

RemyBosman_2-1645715152928.png

 

amitchandak
Super User
Super User

@Anonymous , In this case, seme like a better solution to have bi-directional join.

 

Or have a new column, which populate if there is null/0  marketvalue_exporuse flag

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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