The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I am looking to build a similar view in powerbi, but i am unable to add the measures at the end of the matrix chart. The % good and % not good, are custom measures at the end of matrix chart.
Can someone please guide if this kind of view is achievable in Powerbi. Such views are easily achieveble in excel.
Solved! Go to Solution.
Hi,@snehawankhede
I am glad to help you.
Based on your description, you can refer to my test below
You will need to create a “Head” table to assist the original table.
Here's my test data
M_result =
SWITCH(TRUE(),
SELECTEDVALUE(Header[category])="Material",
SWITCH(TRUE(),
SELECTEDVALUE(Header[name])="Wood",[M_1],
SELECTEDVALUE(Header[name])="Particle Board",[M_1],
SELECTEDVALUE(Header[name])="Iron",[M_1]
),
SELECTEDVALUE(Header[category])="Others",
SWITCH(TRUE(),
SELECTEDVALUE(Header[name])="%Good",[M_%Good],
SELECTEDVALUE(Header[name])="%Not Good",[M_%Not_Good]
)
)
M_1 =
CALCULATE(MAX('Table'[Opinion]),'Table'[Type]=SELECTEDVALUE(Header[name]))
M_%Good =
VAR goodNum=CALCULATE(COUNT('Table'[Opinion]),FILTER(ALL('Table'),'Table'[Sub-Category]=MAX('Table'[Sub-Category])&&'Table'[Opinion]="Good"))
VAR goodNum02=
IF(goodNum=BLANK(),0,goodNum)
VAR allNum=CALCULATE(COUNT('Table'[Opinion]),FILTER(ALL('Table'),'Table'[Sub-Category]=MAX('Table'[Sub-Category])))
RETURN
DIVIDE(goodNum02,allNum,0)
M_%Not_Good =
VAR notgoodNum=CALCULATE(COUNT('Table'[Opinion]),FILTER(ALL('Table'),'Table'[Sub-Category]=MAX('Table'[Sub-Category])&&'Table'[Opinion]="Not Good"))
VAR notgoodNum02=
IF(notgoodNum=BLANK(),0,notgoodNum)
VAR allNum=CALCULATE(COUNT('Table'[Opinion]),FILTER(ALL('Table'),'Table'[Sub-Category]=MAX('Table'[Sub-Category])))
RETURN
DIVIDE(notgoodNum02,allNum,0)
I uploaded the test file, you can refer to it.
I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,@snehawankhede
I am glad to help you.
Based on your description, you can refer to my test below
You will need to create a “Head” table to assist the original table.
Here's my test data
M_result =
SWITCH(TRUE(),
SELECTEDVALUE(Header[category])="Material",
SWITCH(TRUE(),
SELECTEDVALUE(Header[name])="Wood",[M_1],
SELECTEDVALUE(Header[name])="Particle Board",[M_1],
SELECTEDVALUE(Header[name])="Iron",[M_1]
),
SELECTEDVALUE(Header[category])="Others",
SWITCH(TRUE(),
SELECTEDVALUE(Header[name])="%Good",[M_%Good],
SELECTEDVALUE(Header[name])="%Not Good",[M_%Not_Good]
)
)
M_1 =
CALCULATE(MAX('Table'[Opinion]),'Table'[Type]=SELECTEDVALUE(Header[name]))
M_%Good =
VAR goodNum=CALCULATE(COUNT('Table'[Opinion]),FILTER(ALL('Table'),'Table'[Sub-Category]=MAX('Table'[Sub-Category])&&'Table'[Opinion]="Good"))
VAR goodNum02=
IF(goodNum=BLANK(),0,goodNum)
VAR allNum=CALCULATE(COUNT('Table'[Opinion]),FILTER(ALL('Table'),'Table'[Sub-Category]=MAX('Table'[Sub-Category])))
RETURN
DIVIDE(goodNum02,allNum,0)
M_%Not_Good =
VAR notgoodNum=CALCULATE(COUNT('Table'[Opinion]),FILTER(ALL('Table'),'Table'[Sub-Category]=MAX('Table'[Sub-Category])&&'Table'[Opinion]="Not Good"))
VAR notgoodNum02=
IF(notgoodNum=BLANK(),0,notgoodNum)
VAR allNum=CALCULATE(COUNT('Table'[Opinion]),FILTER(ALL('Table'),'Table'[Sub-Category]=MAX('Table'[Sub-Category])))
RETURN
DIVIDE(notgoodNum02,allNum,0)
I uploaded the test file, you can refer to it.
I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
User | Count |
---|---|
78 | |
77 | |
36 | |
32 | |
29 |
User | Count |
---|---|
93 | |
79 | |
57 | |
48 | |
48 |