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
Bond700
Frequent Visitor

insert measure in row in power bi

I need help. There is a pivot table in which in the rows - Companies, in the columns - Months, and in the values ​​- Measure, which defines the segment of companies for each month.
now.PNG
I want to change the pivot table this way: in the rows - Measure, in the columns - Months, and in the values ​​- share of companies in each segment every month.

123.PNG
Excel in the WinRar file,. I will be grateful for help
Do you understand the question or need clarification?

1 ACCEPTED SOLUTION
lc_finance
Solution Sage
Solution Sage

Hi @Bond700 ,

 

 

you can download my proposed solution from here.

 

The solution is to:

1) Generate a new table by segment and by month. Here is the DAX code for it:

Segments by month = GENERATE(segments, VALUES('Calendar'[Date].[Month]))

 

2) Create a measure that will count the % companies in the segment 'new', in the segment 'Top', etc.

Here is the DAX code for it:

% by segment = 

SWITCH(SELECTEDVALUE('Segments by month'[Segment]),
"business", SUMX(VALUES('companies'[name]), IF([Measure]="business",1,0) )
, "new", SUMX(VALUES('companies'[name]), IF([Measure]="new",1,0) )
, "Top", SUMX(VALUES('companies'[name]), IF([Measure]="Top",1,0) )
, "Sleep", SUMX(VALUES('companies'[name]), IF([Measure]="Sleep",1,0) )
) 

/
SUMX(VALUES('companies'[name]),IF(NOT [Measure]=BLANK(),1,0))

 

And this is what it looks like in Power BI:

insert measures in row Power BI

Does this help you?

 

Do not hesitate if you have further questions,

 

LC

Interested in Power BI and DAX templates? Check out my blog at www.finance-bi.com

 

View solution in original post

1 REPLY 1
lc_finance
Solution Sage
Solution Sage

Hi @Bond700 ,

 

 

you can download my proposed solution from here.

 

The solution is to:

1) Generate a new table by segment and by month. Here is the DAX code for it:

Segments by month = GENERATE(segments, VALUES('Calendar'[Date].[Month]))

 

2) Create a measure that will count the % companies in the segment 'new', in the segment 'Top', etc.

Here is the DAX code for it:

% by segment = 

SWITCH(SELECTEDVALUE('Segments by month'[Segment]),
"business", SUMX(VALUES('companies'[name]), IF([Measure]="business",1,0) )
, "new", SUMX(VALUES('companies'[name]), IF([Measure]="new",1,0) )
, "Top", SUMX(VALUES('companies'[name]), IF([Measure]="Top",1,0) )
, "Sleep", SUMX(VALUES('companies'[name]), IF([Measure]="Sleep",1,0) )
) 

/
SUMX(VALUES('companies'[name]),IF(NOT [Measure]=BLANK(),1,0))

 

And this is what it looks like in Power BI:

insert measures in row Power BI

Does this help you?

 

Do not hesitate if you have further questions,

 

LC

Interested in Power BI and DAX templates? Check out my blog at www.finance-bi.com

 

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