Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register 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
User | Count |
---|---|
84 | |
77 | |
76 | |
43 | |
36 |
User | Count |
---|---|
109 | |
56 | |
52 | |
45 | |
43 |