Forum Discussion
Create Visual on frontend measures
Thanks for your solution, but I don't have the access to create new table in Power BI. Can we do it by any other way without using new table ?
Hi, Anonymous
Why can't you New Table, and what type of data source are you connecting to?
If it says that you can't New Table, but you have to use a Measure that you created earlier, then unfortunately you can't use a bar chart to show the values of pass or fail. You can use Table visual or Matrix visual, etc. because Measure cannot be placed on the X axis.
Since I have no way of knowing the computational logic behind your Measure, I'm still testing using the example I mentioned to you earlier.
For details you can refer to a new Measure I created instead of using New Table to calculate the pass or fail values:
PassOrFail =
SWITCH (
TRUE (),
ISERROR ( SUM ( 'Score'[Score] ) ), "Error",
SUM ( 'Score'[Score] ) >= 60, "Pass",
SUM ( 'Score'[Score] ) < 60, "Fail"
)
(This Measure PassOrFail is equivalent to the Measure you use to calculate pass or fail logic)
Showing the value of pass or fail:
M_1 =
VAR _value = [PassOrFail]
RETURN
CALCULATE (
COUNTAX ( 'Score', [PassOrFail] ),
FILTER ( ALL ( Score ), 'Score'[PassOrFail] = _value )
)
Or can you modify the Measure you created to calculate columns, the X-axis can only place columns that exist in the table. If you can consider using calculated columns, you can refer to another option:
First create a calculated column to calculate pass or fail:
failorpass =
IF ( 'Score'[Score] < 60, "fail", "pass" )
Then create a Measure to calculate the value of pass or fail:
M_2 =
VAR _value =
MAX ( 'Score'[failorpass] )
RETURN
CALCULATE (
COUNT ( 'Score'[failorpass] ),
FILTER ( ALL ( Score ), 'Score'[PassOrFail] = _value )
)
This is the result shown using a bar graph:
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.
I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Fen Ling,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.