Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
baneworth
Helper II
Helper II

calculate total DAX issue

Hey Community

 

If you could take a look i would appreciate it.

 

Problem:

I get Location Data (SubLoc) in form of single line of text like PM1 or PM1,PM2 or PM1,PM2,PM3,PM4 and so on.....

Now each PM (Process Module) should get counted individual, in case of PM1 = 1, PM1,PM2 = 2,....

 

Therefore i setup an excel file with all possible outcomes and assigned the count.

 

Now after importing it seems the created count does not get auto calculated. I am struggling with the correct DAX now to get the total of count.

 

subloc count.png

 

I thought that the ID can be used with the count somehow.

 

Any input is welcome to get the total of count row

Thank you

1 ACCEPTED SOLUTION
v-cgao-msft
Community Support
Community Support

Hi @baneworth ,

My steps are to go to Power Query Editor first. Select the [SubLoc] column and split the column.

vcgaomsft_0-1665127801860.png

vcgaomsft_1-1665127838446.png

Select these four columns and unpivot the columns.

vcgaomsft_2-1665127878316.png

vcgaomsft_3-1665127983999.png

Then new two measures:

 

SubLoc = CONCATENATEX(FILTER('Table','Table'[Serial Number]=MAX('Table'[Serial Number])&&'Table'[ID]=MAX('Table'[ID])&&'Table'[Loc]=MAX('Table'[Loc])),'Table'[Value],",")
Count = COUNT('Table'[Value])

 

vcgaomsft_4-1665128330220.png

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

View solution in original post

2 REPLIES 2
v-cgao-msft
Community Support
Community Support

Hi @baneworth ,

My steps are to go to Power Query Editor first. Select the [SubLoc] column and split the column.

vcgaomsft_0-1665127801860.png

vcgaomsft_1-1665127838446.png

Select these four columns and unpivot the columns.

vcgaomsft_2-1665127878316.png

vcgaomsft_3-1665127983999.png

Then new two measures:

 

SubLoc = CONCATENATEX(FILTER('Table','Table'[Serial Number]=MAX('Table'[Serial Number])&&'Table'[ID]=MAX('Table'[ID])&&'Table'[Loc]=MAX('Table'[Loc])),'Table'[Value],",")
Count = COUNT('Table'[Value])

 

vcgaomsft_4-1665128330220.png

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

Hey @v-cgao-msft,

 

Thank you, appreciate it a lot

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.