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

Summarize, SummarizeColumns or a 3rd option

Hi,

I am currently trying to solve a table manipulation issue i DAX. The problem is; I would like to take the last value in the period (Dec = 35) and use this as constant in a calculation where I compare Value and Contant to see how many values are higher than the constant (Result = 5).

 

We are running on a tabular model so this would have to be done in DAX. The period start and end is variable and I would like to have the solution respect the slicers used in Power BI.

 

I have been investigating SUMMARIZE, SUMMARIZECOLUMNS and GROUPBY but have yet to find a good solution.

 

Anmærkning 2019-09-19 090529.png

 

 

 

 

1 ACCEPTED SOLUTION

Since you have a tabular model, I assume that you don't have to use month names for determening the last month, but can use something like month number or date:

ComparisonMeasure =
VAR mxMon =
    CALCULATE ( MAX ( 'Table'[Month] ); ALL ( 'Table' ) )
VAR mxVal =
    CALCULATE (
        VALUES ( 'Table'[Values] );
        FILTER ( ALL ( 'Table' ); 'Table'[Month] = mxMon )
    )
RETURN
    COUNTROWS ( FILTER ( 'Table'; 'Table'[Values] > mxVal ) )

View solution in original post

5 REPLIES 5
sturlaws
Resident Rockstar
Resident Rockstar

Hi,

Do you want to add a calculated column, or do you need a temporary table in a measure?

 

For a calculated column you can do this

Comparison =
VAR mxMon =
    CALCULATE ( MAX ( 'Table'[Month] ); ALL ( 'Table' ) )
VAR mxVal =
    CALCULATE (
        VALUES ( 'Table'[Values] );
        FILTER ( ALL ( 'Table' ); 'Table'[Month] = mxMon )
    )
RETURN
    IF ( 'Table'[Values] > mxVal; 1; 0 )

cheers,
S

Anonymous
Not applicable

Hi,

 

Since we are running on a tabular model and have variable period start and end i am thinking temporary table in measure.

 

Thanks

Since you have a tabular model, I assume that you don't have to use month names for determening the last month, but can use something like month number or date:

ComparisonMeasure =
VAR mxMon =
    CALCULATE ( MAX ( 'Table'[Month] ); ALL ( 'Table' ) )
VAR mxVal =
    CALCULATE (
        VALUES ( 'Table'[Values] );
        FILTER ( ALL ( 'Table' ); 'Table'[Month] = mxMon )
    )
RETURN
    COUNTROWS ( FILTER ( 'Table'; 'Table'[Values] > mxVal ) )
Anonymous
Not applicable

Correct, number or date are both available.

So then you have everything you need to solve it?

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