cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Super User IV
Super User IV

Re: What If parameter value as scalar in condition for added column

@PBIuseNpa question, why you are summarizing the table, try this though

 

summary = 
SUMMARIZE(
      FILTER('NC records',[ShowNoShow] = "Show"), 
      'NC records'[Category], 
      "NC count", DISTINCTCOUNT('NC records'[NC Num])
)

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!






Did I answer your question? Mark my post as a solution.

Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





Highlighted
Helper I
Helper I

Re: What If parameter value as scalar in condition for added column

@AllisonKennedy, Thanks for clarifying. NC count works as-is. If summary is created in query editor will I be able to use the parameter-connected ShowNoShow field in NC records (added using DAX) to control which records are refelected in summary?

 

Re: Using ShowNoShow as measure in NC records means using SUMMARIZECOLUMNS to create summary won't work. Does this also apply to function SELECTCOLUMNS?

 

What I'm looking for is a way to use a What If parameter to control which records in table NC records are passed to table summary where summary contains Category and a count of NC Num and NC records contains Category, NC Num and Date.

Highlighted
Community Champion
Community Champion

Re: What If parameter value as scalar in condition for added column

@PBIuseNpa  yes, since the ShowNoShow is now being created as a MEASURE it will still work even if you change how NC Count is calculated, or if you use my previous suggestion for NC Count as a MEASURE then it will automatically filter based on your date parameter (showNoShow) criteria without needing the showNoShow field/measure or column. You will simply need to add the NC Count measure to the table or matrix visualization along with the category from the summary table (again I would call this a dimension table rather than summary, but naming convention doesn't change the outcome). 

 


@PBIuseNpa wrote:

 

 

Re: Using ShowNoShow as measure in NC records means using SUMMARIZECOLUMNS to create summary won't work. Does this also apply to function SELECTCOLUMNS?

 

 


Yes, using DAX ...COLUNMS function or any function which requires column as argument will not work with a MEASURE.

 

Has this post solved your problem? Please mark it as a solution so that others can find it quickly and to let the community know your problem has been solved. 

 

If you found this post helpful, please give Kudos.

I work as a trainer and consultant for Microsoft 365, specialising in Power BI and Power Query. 

https://sites.google.com/site/allisonkennedycv

 


______________


Has this post solved your problem? Please mark it as a solution so that others can find it quickly and to let the community know your problem has been solved. 


If you found this post helpful, please give Kudos.


I work as a trainer and consultant for Microsoft 365, specialising in Power BI and Power Query. 


https://sites.google.com/site/allisonkennedycv

Highlighted
Helper I
Helper I

Re: What If parameter value as scalar in condition for added column

@parry2k, Thank you. This code doesn't work. summary still shows nothing.

parry2k update, 04-May.png

 

The Pareto chart needs to present NC count by category. And date cannot be included because there is a many to one relationship between NC Num and date. A Pareto of Count(NC Num & Date) and category looks very different from a Pareto of NC count and category.

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Upcoming Events

Upcoming Events

Wondering what events you could join or have an event to promote yourself? Check out our Upcoming Events.

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

We are thrilled to announce we will begin running a monthly webinar series named Power BI Dev Camp.

Top Solution Authors
Top Kudoed Authors