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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
ryan_b_fiting
Post Patron
Post Patron

Calculation Group - Calculation Item Measure Help

Hello Community - 

I am in need of some help writing a calculation item within my calculation group.  I currently have a calc group with 4 items in it and then it is pulled into a matrix against some of my base measures (as rows).

Matrix.png

Here are calculation item DAX measures:

YTD = 

CALCULATE ( SELECTEDMEASURE(), DATESYTD ( Date_Table[Date] ) )

PYTD = 

VAR _YTD = CALCULATE ( SELECTEDMEASURE(), DATESYTD ( Date_Table[Date] ) ) 
RETURN CALCULATE
( SELECTEDMEASURE() , SAMEPERIODLASTYEAR ( Date_Table[Date] ) )

YoY Value = 

VAR _CY = selectedmeasure() 
VAR
_LY = calculate ( selectedmeasure(), sameperiodlastyear(Date_Table[Date]))
RETURN
_CY - _LY

YoY % = 

VAR _CY = selectedmeasure() 
VAR
_LY = calculate ( selectedmeasure(), sameperiodlastyear(Date_Table[Date]))
VAR
_YoY = _CY - _LY
RETURN DIVIDE
(_YoY,_LY,0 )

 Now I am trying to created a calculation item that will give me the COUNT of the customers that had YoY growth > 0 and a calculation item that will SUM the growth of those customers (for Sales, GP1 and Lines only).

If I create this basic measure, I get the output that I want, but I cannot add it to my matrix as a column (next to my calculation item measures).

 

Lines Up = CALCULATE(
    COUNTROWS( SUMMARIZE('Master_Tbl','Master_Tbl'[Customer])),
    FILTER( SUMMARIZE('Master_Tbl','Master_Tbl'[Customer] ), [YoY Lines] > 0 )
    )

 

How can I replicate the above measure as a calcluation item for only Sales, GP1 and Lines, leaving all other row measures in my matrix blank?

 

Your help is always appreciated!

Ryan

2 REPLIES 2
amitchandak
Super User
Super User

@ryan_b_fiting , I think, very similar to YOY.

 

example

 

Lines Up =
VAR _CY = selectedmeasure()
VAR _LY = calculate ( selectedmeasure(), sameperiodlastyear(Date_Table[Date]))
VAR _YoY = _CY - _LY

CALCULATE(
COUNTROWS( SUMMARIZE('Master_Tbl','Master_Tbl'[Customer])),
FILTER( SUMMARIZE('Master_Tbl','Master_Tbl'[Customer] ), _YoY > 0 )
)

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

@amitchandak thanks for the reply.  I have already tried that, but that does not work.  That gives me the same value across all base measures, and it does not allow me the 'BLANK' value measures that I do not want to see YoY count for (only want to see it for Sales, Lines, GP1)

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

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.