cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

Create a calc column DAX formula for a specific need

HI all - 

 

You have all been so helpful! Love this forum!

 

I am very new to PBI.  Loving it!

 

I need to create a calculated column in a table I am working with.

 

One column is a BILL TO code... ie.  9132.

 

These codes are for identifying a set of specific retail outlet stores... ie. WalMart

 

The formula used in another application is basically :

Bill To = 41944/ACADEMY, Bill To = 9132, 6180, 501384, 431016/BPCAB, Bill To 5825, 45361/SPORTSMAN, Bill To = 6050/DICKS, Bill To 7181, 534798/GANDER, Bill To NE that listed/SCHEELS

 

How do i write this in DAX?  Thanks in advance!

 

Matt

4 REPLIES 4
Community Support
Community Support

Hi @matthewwbowers ,

 

Check the formula below, If i misunderstand your meanings please let me know.

Column = CALCULATE(MAX('Table (2)'[value]),FILTER('Table (2)','Table'[BILL TO code]='Table (2)'[BILL TO code]))

 6.PNG

7.PNG

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution to help the other members find it.
Frequent Visitor

Actually, I was not clear.  The two values are text values.  I think the DAX substitute function will do what i want.  Thanks!

 

Super User I
Super User I

are you wanting to filter by those outlets?

then you would use a filter function

ie

https://forum.enterprisedna.co/t/writing-a-dax-function-to-filter-out-multiple-criteria-for-a-given-...

Filtered Total Sales =
CALCULATE(
[Total Sales],
FILTER(
Outlet,
OutletName = "insertnamehere" ||
OutletName = "insertnamehere" ||

OutletName = "insertnamehere" )
)

|| = or




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

Proud to be a Super User!




Super User IV
Super User IV

@matthewwbowers , not very clear

example

calculate(sum(table[value]), filter(table, table[Bill To] in {"41944/ACADEMY","9132", "6180", "501384", "431016/BPCAB", "5825","45361/SPORTSMAN"}))



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Helpful resources

Announcements
secondImage

Congratulations!

We are excited to announce the Power BI Super Users!

Wave Release 2

Check out the updates in Power BI.

Overview of Power BI 2020 release wave 2!

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors