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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

SUM BKG No but Distinct if there are Duplicate of BKG No

Hi Team

 

Its me again

almost similiar with prev question

 

i had table of BKG No

SUM BKG Distinc.png

 

common SUM result RED Column
i want result in Green Column

 

Pls help me In Dax .

( write me DAX , so i can sopy it )

i still confuse of using it

 

Thanks and really appreciate any help and respond

 

Regards

Syaiful Efendi

 

 

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

Hi @Anonymous 

Create a measure

Measure = DISTINCTCOUNT('Table'[No Booking])

Capture4.JPG

If there is another column added into the table visual, you can create measures

rank =
RANKX (
    FILTER (
        ALLSELECTED ( 'Table' ),
        'Table'[No Booking]
            = MAX ( 'Table'[No Booking] )
    ),
    CALCULATE (
        MAX ( 'Table'[Index] )
    ),
    ,
    ASC,
    DENSE
)

Measure 2 =
IF (
    [rank] = 1,
    CALCULATE (
        DISTINCTCOUNT ( 'Table'[No Booking] ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            'Table'[No Booking]
                = MAX ( 'Table'[No Booking] )
        )
    )
)


Measure 3 = IF(ISINSCOPE('Table'[No Booking]),[Measure 2],SUMX(ALLSELECTED('Table'),[Measure 2]))

Capture5.JPG

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

Create a measure

Measure = DISTINCTCOUNT('Table'[No Booking])

Capture4.JPG

If there is another column added into the table visual, you can create measures

rank =
RANKX (
    FILTER (
        ALLSELECTED ( 'Table' ),
        'Table'[No Booking]
            = MAX ( 'Table'[No Booking] )
    ),
    CALCULATE (
        MAX ( 'Table'[Index] )
    ),
    ,
    ASC,
    DENSE
)

Measure 2 =
IF (
    [rank] = 1,
    CALCULATE (
        DISTINCTCOUNT ( 'Table'[No Booking] ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            'Table'[No Booking]
                = MAX ( 'Table'[No Booking] )
        )
    )
)


Measure 3 = IF(ISINSCOPE('Table'[No Booking]),[Measure 2],SUMX(ALLSELECTED('Table'),[Measure 2]))

Capture5.JPG

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

pceglie
Resolver I
Resolver I

Hi @Anonymous , in dax you can create a table starting from your original table grouping by "No Booking" column.

 

Hope it will help you.

 

P.

Anonymous
Not applicable

show me in dax pls

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.