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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
DennisPedersen
Frequent Visitor

DAX Measure Calculate only on certain rows

Hi

 

In the measure below i create the same value for many dimensions from the table "vReporting".

However I further need this calculation only to be done for one certain value from "vReporting".

 

So something like IF(vReporting[AccountNo=1,Test2,0)

 

Can I in some way include this condition in my measure?

 

The thing is that measure Test2 includes a higher value than vReporting[AccountNo=1

 

Test2:=

CALCULATE (

 

[Actual period];

FILTER (

ALL ( 'Dim_Time' );

'Dim_Time'[Year] = MAX ( 'Dim_Time'[Year] )

&& 'DIM_Time'[DateValue] <= MAX ( 'DIM_Time'[DateValue])

) ;FILTER (

ALL ( 'vReporting' );

'vReporting'[Type] = "Resultatopgørelse"

 

&& 'vReporting'[Niv] = 0

))

 

4 REPLIES 4
v-juanli-msft
Community Support
Community Support

Hi @DennisPedersen

Does [Actual period] calculate using "distinct" or any else ?

Maybe the [Actual period] using a table function which will return  a table not a column.

 

Best Regards

Maggie  

Hi again

 

Actual period:=sum('FinanceGLEntry-'[Amount2])

 

did that help?

v-juanli-msft
Community Support
Community Support

Hi @DennisPedersen

What do you mean by saying "measure Test2 includes a higher value than vReporting[AccountNo=1"?

 

Best regards

Maggie

Hi Maggie

 

Thanks for helping.

I came a litte longer so that it now looks like this:

But now my problem is that when I try to put 'FinanceGLEntry-'[G_L Account No_

in a row in a excel pivottable excel is saying that more values were returned where only 1 was expected?

 

 

Copy of Test2:= if(values('FinanceGLEntry-'[G_L Account No_])="707150";

CALCULATE (

 

[Actual period];

FILTER (

ALL ( 'Dim_Time' );

'Dim_Time'[Year] = MAX ( 'Dim_Time'[Year] )

&& 'DIM_Time'[DateValue] <= MAX ( 'DIM_Time'[DateValue])

) ;FILTER (

ALL ( 'vReporting' );

'vReporting'[Type] = "Resultatopgørelse"

 

&& 'vReporting'[Niv] = 0

));0)

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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