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

Total in Visual (like count if Excel)

I need a resume table like Excel using count.If

 

screenshot.1126.jpg

 

Visual in Power BI needed:

 

screenshot.1161.jpg

 

I tried:

 

screenshot.1162.jpg

Database example: https://1drv.ms/x/s!AuUNmh5pyq5g93rKg_a-sEJWzfc_?e=AzWweb

 

3 REPLIES 3
Community Support Team
Community Support Team

Re: Total in Visual (like count if Excel)

Hi j_martinho,

It seems that you want to calculate sum based Area desbloqueio, when you add this field in Table and add Pago, it will automatically calculate sum for you

344.PNG

In addition, you could try below measure to calculate count

Measure 4 = CALCULATE(COUNT('Table'[Area desbloqueio]), ALLEXCEPT('Table','Table'[Area desbloqueio]))

By the way, if possible, could you please inform me the error in English and explain the logic of below(count?)

345.PNG

Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Highlighted
j_martinho Frequent Visitor
Frequent Visitor

Re: Total in Visual (like count if Excel)

Hi @dax 

 

I have in the source table the ID that would be "Documento" and respectively two columns containing one the release location ("Area Lancamento") and the other the unlock location ("Area Desbloqueio"). I want to calculate the total sum by location and the amount of releases and unlocks by location.

I enter the "Area Lancamento" column in Visual, then a new columm DistinctCount "Area Lancamento", and when I enter DistinctCount for "Area Desbloqueio" the total per area of ​​the two columns is the same.

I have tried some DAX fomulas without success.

 

Valor Pago = SUM "Valor Pago"

Qtd Lancamentos = Distinctcount "Area Lancamento"

Qtd Desbloqueios= Distinctcount "Area Desbloqueio"

 

Error using ADDCOLUMNS or SUMMARIZE: The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value

 

Data Source Sample: https://1drv.ms/x/s!AuUNmh5pyq5g93rKg_a-sEJWzfc_?e=AzWweb

Community Support Team
Community Support Team

Re: Total in Visual (like count if Excel)

Hi j_martinho, 

I am sorry for late reply, I am not clear about your requirement. If you want to count distinct based on Area Lancamento and Area Desbloqueio, you could try to use below

Measure 7 = DISTINCTCOUNT(Table1[Area Desbloqueio])
Measure 8 = DISTINCTCOUNT(Table1[Area Lancamento])

If possible, could you please inform me your expected output? Then I will help you more correctly.

Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 51 members 1,110 guests
Please welcome our newest community members: