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
Anonymous
Not applicable

Dax Tweak

Hi All,

 

 

Just need to tweak my dax calc guide me to get results shown in the figure below

 

 

 

 snap1.PNG

3 ACCEPTED SOLUTIONS

Hi @Anonymous,

 

Try below DAX:

Private Evnt =
CALCULATE (
    COUNT ( EVNT_SCH_F[EVNT_SCH_ID] ),
    FILTER (
        [YOUR TABLE NAME],
        EVNT_SCH_D[DLVR_TYPE_NM] = "Private"
            && EVNT_SCH_D[SCH_STAT_CD] = "DONE"
    )
)
Private Evnt =
CALCULATE (
    COUNT ( EVNT_SCH_F[EVNT_SCH_ID] ),
    FILTER (
        [YOUR TABLE NAME],
        EVNT_SCH_D[DLVR_TYPE_NM] = "Public"
            && EVNT_SCH_D[SCH_STAT_CD] = "DONE"
    )
)

Replace [Your Table Name] with your actual table name in which these columns are present. That should work.

 

Prateek Raina

 

 

View solution in original post

Anonymous
Not applicable

Hi Prateek,

 

 

Its working thanks for your solution but in current scenario, it is excluding blanks should I use instead Filter  ISBlank function for including blanks.

 

Thanks

View solution in original post

@Anonymous

 

You need to add condition for including blank also then. Normally its written like [Field] = BLANK()

Also, kindly thumbs up my answer if i have resolved your problem 🙂

 

Prateek Raina

View solution in original post

7 REPLIES 7
prateekraina
Memorable Member
Memorable Member

Hi @Anonymous,

 

Try below DAX:

Private Evnt= CALCULATE(COUNT(EVNT_SCH_F[EVNT_SCH_ID]),EVNT_SCH_D[DLVR_TYPE_NM]="Private" && EVNT_SCH_D[SCH_STAT_CD] = "DONE")

 

Public Evnt= CALCULATE(COUNT(EVNT_SCH_F[EVNT_SCH_ID]),EVNT_SCH_D[DLVR_TYPE_NM]="Public" && EVNT_SCH_D[SCH_STAT_CD] = "DONE")

 I hope there are no syntatical errors as i have just typed in between your code 🙂

 

Prateek Raina

Hi @Anonymous,

 

Try below DAX:

Private Evnt =
CALCULATE (
    COUNT ( EVNT_SCH_F[EVNT_SCH_ID] ),
    FILTER (
        [YOUR TABLE NAME],
        EVNT_SCH_D[DLVR_TYPE_NM] = "Private"
            && EVNT_SCH_D[SCH_STAT_CD] = "DONE"
    )
)
Private Evnt =
CALCULATE (
    COUNT ( EVNT_SCH_F[EVNT_SCH_ID] ),
    FILTER (
        [YOUR TABLE NAME],
        EVNT_SCH_D[DLVR_TYPE_NM] = "Public"
            && EVNT_SCH_D[SCH_STAT_CD] = "DONE"
    )
)

Replace [Your Table Name] with your actual table name in which these columns are present. That should work.

 

Prateek Raina

 

 

Anonymous
Not applicable

Hi Prateek,

 

 

Its working thanks for your solution but in current scenario, it is excluding blanks should I use instead Filter  ISBlank function for including blanks.

 

Thanks

@Anonymous

 

You need to add condition for including blank also then. Normally its written like [Field] = BLANK()

Also, kindly thumbs up my answer if i have resolved your problem 🙂

 

Prateek Raina

Anonymous
Not applicable

Hi Prateek,

 

Im experiencing syntax error 

 

Thanks

kng

Whats the error? Can you upload screenshot of error?

Anonymous
Not applicable

snip1.PNG

 

 

Hi Prateek,

 

Find above error snapshot when I apply code

 

Thanks

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.