Forum Discussion
Create Visual on frontend measures
Hi,
I have created one measure on PowerBI Desktop having only pass and fail values based on logic, now we want to create bar type chart on count of these pass and fail values. Is it possible to do so ? That measure will have only pass or fail values.
Thanks,
Bhimashankar
7 Replies
- AnonymousNot applicable
Hi, rajendraongole1
I am in favor of your approach.
And I would like to share some additional solutions below.
Hi, Anonymous
I am glad to help you.
According to your description, you want to create bar type chart on count of these pass and fail values?
If I understand you correctly, then you can refer to my solution.
Since you didn't give specific test data, I created a simple dataset based on your description and tested a simple example, so I hope this helps.
Dataset:
Create a Measure calculation Pass or Fail:
PassOrFail = SWITCH ( TRUE (), ISERROR ( SUM ( 'Score'[Score] ) ), "Error", SUM ( 'Score'[Score] ) >= 60, "Pass", SUM ( 'Score'[Score] ) < 60, "Fail" )Based on this logical Measure, create a table for counting the number of passes or failures via New Table:
PassFailCountTable = SUMMARIZE ( ADDCOLUMNS ( 'Score', "PassOrFail", [PassOrFail] ), [PassOrFail], "Count", COUNTROWS ( 'Score' ) )Apply the newly created table to the bar chart:
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.- AnonymousNot applicable
Thanks for your detailed solution. I tried on PowerBI Desktop, data from excel it is working fine. Unfortunately I don't have access to create table on frontend is there any other way to do it ?
- rajendraongole1Super User
Hi Anonymous - Can please share some sample data for more analysis, it helps to understand
as per my understanding , you can create a measure that uses a SWITCH statement to dynamically count Pass and Fail based on a selected value
DynamicCount =
SWITCH (
SELECTEDVALUE('PassFailTable'[PassFail]),
"Pass", CALCULATE(COUNTROWS('YourTable'), 'YourTable'[PassFailMeasure] = "Pass"),
"Fail", CALCULATE(COUNTROWS('YourTable'), 'YourTable'[PassFailMeasure] = "Fail"),
BLANK()
)Hope it works and helps
Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!- AnonymousNot applicable
Here is data in WorkUnit Table and PF is measure created on frontend based on logic.
Work Units Class Code PF 2P006 110 Pass 2A010 114 Fail 2A011 105 Fail 2J012 109 Pass 2A013 105 Fail 2W014 105 Pass 2M015 110 Fail 2A016 105 Fail 2Q017 105 Fail 2A018 103 Pass 2F019 105 Fail 2A021 101 Pass 2A022 105 Pass From your suggested answer I don't any 'PassFailTable' ?
Please refer data above and table name, as suggested by Anonymous It worked but I don't have access to create new table on frontend.- AnonymousNot applicable
Hi, Anonymous
New Table is done in Power BI Desktop as follows:
I don't know the calculation logic of your Measure CodePF.
In my example, my Measure PassOrFail is your Measure CodePF, you just need to change the corresponding parameter in the DAX formula of New Table:PassFailCountTable = SUMMARIZE ( ADDCOLUMNS ( 'WorkUnit', "PassOrFail", [CodePF] ), [CodePF], "Count", COUNTROWS ( 'WorkUnit' ) )
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.