Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
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.
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.
Excel in the WinRar file,. I will be grateful for help
Do you understand the question or need clarification?
Solved! Go to Solution.
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:
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
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:
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
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 103 | |
| 80 | |
| 64 | |
| 50 | |
| 45 |