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
EngCicero
New Member

Defining a measure for several columns

Hi,

i have a table like this

 

sale IDseller IDError type 1type 2type 3type 4type 5
140736742552error error  
154564108554     
205626417558  errorerror 
42810745554 error   
32667322'552  error error

 

I want a measure to sum number of errors for all table, like total number of errors = 7

 

The only wayi thinking to do is =

CALCULATE( COUNT('data'[type2), data'[type2) = "error")
then sum all this measures.
Please, I need a quicker way
7 REPLIES 7
v-luwang-msft
Community Support
Community Support

Hi @EngCicero ,

Has your problem been solved, if so, please consider Accept a correct reply as the solution or share your own solution to help others find it.

Best Regards
Lucien


Best Regards

Lucien

v-luwang-msft
Community Support
Community Support

Ashish_Mathur
Super User
Super User

Hi,

In the Query Editor, select the first 2 columns, right click and select "Unpivot Other Columns".  Now write this measure

Errors = calculate(countrows(data),data[value]="error")

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hello @Ashish_Mathur n @Greg_Deckler .

I didn't make myself clear enough, tihs error cells are tests for a process, this functions are not in my database. those errors are the results of more complex Switchs tests.
I'm stucked here
Thank you both anyway

@EngCicero OK, then you want MC Aggregations: Multi-Column Aggregations (MC Aggregations) - Microsoft Power BI Community


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Hi,

I am sorry but i do not understand your requirement.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Greg_Deckler
Super User
Super User

@EngCicero I would highly recommend unpivoting your "error" columns. If not that, then you are stuck with MC Aggregations: Multi-Column Aggregations (MC Aggregations) - Microsoft Power BI Community


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.