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
ayoubb
Helper IV
Helper IV

counting number of tickets changed the groupe

Hello, 

 

First i appreciate your help, because of you i have learned such things in BI;

 

i revert back to you to help me for counting how many  distinction [N demande] were in [Statut] "En cours" and [Groupe utilisateur] "SAF_N1" and then changed the groupe to any other groupe except "SAF_N1" and "SAF_N0 "

 

 

Count.JPG

 

Thanks a lot 

1 ACCEPTED SOLUTION

because the tickets they repeated i got more than it should be, i need to add dinstinct to this formula: 

 

= countrows(EXCEPT(selectcolumns(filter('Statut des DS','Statut des DS'[Groupe Historisé]="SAF_N1"),"ticket",[N° demande de service]),selectcolumns(filter('Statut des DS','Statut des DS'[Groupe Historisé]="SAF_ESC"),"Tiket",[N° demande de service])))

View solution in original post

6 REPLIES 6
Greg_Deckler
Super User
Super User

@ayoubb Can you post sample data as text and expected output? Otherwise, I am thinking some sort of table variables with filters and maybe EXCEPT or INTERSECT?

 

Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.


@ 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...

Maybe i was not clear, i want to calculte what it is highlited below, Distinction ticket in [n° demande de service] with [statut] "En cours" in groupe "SAF_N1" and changed the groupe to SAF_ESC and the other one to SAF_COM 

 

if you help me to create this DAX the result should be: 2 

 

to explain further this result, it means two tickets were in SAF_N1 and switched to SAF_ESC and SAF_COM

 

Count.JPG

amitchandak
Super User
Super User

@ayoubb , Not very clear, Try if this measure can help

CALCUALTE(count(Table[N demande] ) , filter(Table,Table[Statut] <> Table[Groupe utilisateur]))

I want to count how many ticket were in SAF_N1 and changed the groupe to SAF_ESC? 

@ayoubb , try like

countrows(excpet(selectcolumns(filter(Table,Table[Statut]="SAF_N1"),"N demande",[N demande]),selectcolumns(filter(Table,Table[Groupe utilisateur]="SAF_ESC"),"N demande",[N demande])))

 

Distinct might be required if ticket no repeats

because the tickets they repeated i got more than it should be, i need to add dinstinct to this formula: 

 

= countrows(EXCEPT(selectcolumns(filter('Statut des DS','Statut des DS'[Groupe Historisé]="SAF_N1"),"ticket",[N° demande de service]),selectcolumns(filter('Statut des DS','Statut des DS'[Groupe Historisé]="SAF_ESC"),"Tiket",[N° demande de service])))

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.