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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Measure in a measure skips row context in report view

Hi Community,

 

I've run into a problem with DAX. Usually I find my answer on this community as millions probably have asked the same question but I can't find it.

Maybe becasue I don't use the right keywords. In any case, I would be very grateful if you could help me.

I'm trying to rebuild a power BI forecast with measures instead of calculated columns as that file became way too big in terms of file size.

I have a dynamic measure ([BL1 Unfunded Old Contracts]) that currently outputs 0,9339 and I want to use that measure in a new measure (Disbursements Next Quarter BL1). This new measure is related to a date table.

If I use the dynamic measure to calculate the new measure it gives me output on a total level but doesn't output the row context I want to see in my Report view. 

Is there any way I can use this measure in my new measure without adding columns or hard coding the output?

Unfortunately I can't share my data as it's my companies data. If necessary I can make dummy data but I figured this question might not require actual data.

 

DAX formula:

Disbursements Next Quarter BL1 =
VAR _NQ = SELECTEDVALUE( 'Datumtabel'[rYearQuarter] )
VAR Unfunded = [BL1 Unfunded Old Contracts]
RETURN
CALCULATE(
SUMX(Contracttbl;Contracttbl[Commitment left EURO])*Unfunded;
ALL( 'Datumtabel' );
'Contracttbl'[Business line]="Support to early stage finance activities";
TREATAS( { _NQ + 1 }; 'Datumtabel'[rYearQuarter])
)

 

Result in report view:

SCBD NumberDisbursements Next Quarter BL1
Total381.709,52

 

This is correct for the total amount, however I want it to show different SCBD number rows. DAX only gives me different rows in the report view when I write this:

DAX:

Disbursements Next Quarter BL1 =
VAR _NQ = SELECTEDVALUE( 'Datumtabel'[rYearQuarter] )
VAR Unfunded = 0,9339
RETURN
CALCULATE(
SUMX(Contracttbl;Contracttbl[Commitment left EURO])*Unfunded;
ALL( 'Datumtabel' );
'Contracttbl'[Business line]="Support to early stage finance activities";
TREATAS( { _NQ + 1 }; 'Datumtabel'[rYearQuarter])
)

Result in report view:

SCBD NumberDisbursements Next Quarter BL1
SCBD-1018-0158.275,36
SCBD-1020-0174.326,85
SCBD-1020-020,00
SCBD-1021-01249.163,88
Total381.709,52
1 ACCEPTED SOLUTION
Anonymous
Not applicable

@saraMissBI @Fowmy . Thanks for your help! I figured it out thanks to your help. The rows that the measure calculated to were no the same rows as the new measure calculated. I ended up making a calculated column in another table to preserve the row context in the new measure.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

@saraMissBI @Fowmy . Thanks for your help! I figured it out thanks to your help. The rows that the measure calculated to were no the same rows as the new measure calculated. I ended up making a calculated column in another table to preserve the row context in the new measure.

saraMissBI
Resolver I
Resolver I

Hi @Anonymous ,

 

Have you tried viewing your dynamic measure by SCBD number to make sure your measure slices data by SCBD? Does it return correct numbers for each row? It is better to test your first measure and then tackle the second measure?

 

Thank you

Fowmy
Super User
Super User

@Anonymous 

Your measure [BL1 Unfunded Old Contracts]  is stored in a variable so it doesn't recalculate within SUMX, call the measure directly win SUMEX like below.

 

Disbursements Next Quarter BL1 =
VAR _NQ =
    SELECTEDVALUE ( 'Datumtabel'[rYearQuarter] )
//VAR Unfunded = 0,9339
RETURN
    CALCULATE (
        SUMX ( Contracttbl; Contracttbl[Commitment left EURO] ) * [BL1 Unfunded Old Contracts];
        ALL ( 'Datumtabel' );
        'Contracttbl'[Business line] = "Support to early stage finance activities";
        TREATAS ( { _NQ + 1 }; 'Datumtabel'[rYearQuarter] )
    )



 

________________________

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

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube, LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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