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
BalaKiranM
Helper II
Helper II

Need help in DAX Measure

Experts, I need your help to fix the DAX formula. The below measure should sum up all the values as denominator in the measure. Actually, I am not able to sum those values as Link ID column datatype in text. Below is the measure written with hardcoded value, but I would like to see that in dynamically should sum up in denominator.

 

% Link ID = DISTINCTCOUNT('Query 1'[Link ID])/206 (This should replace with the Total Sum Value of yellow box highligted one)
 
BalaKiranM_0-1672394601194.png

 

Thanks,

Bala

 

 

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@BalaKiranM , Try a measure like

 

% Link ID = divide( DISTINCTCOUNT('Query 1'[Link ID]), calculate( DISTINCTCOUNT('Query 1'[Link ID]), allselected())

 

https://learn.microsoft.com/en-us/dax/allselected-function-dax

View solution in original post

v-shex-msft
Community Support
Community Support

Hi @BalaKiranM,

I'd like to suggest you add a variable with summarize function to aggregate these ID at first, then you can simply summary these results to calculate with current id:

% Link ID =
VAR summary =
    SUMMARIZE (
        ALLSELECTED ( 'Query 1' ),
        [Category],
        "DC LID", DISTINCTCOUNT ( 'Query 1'[Link ID] )
    )
RETURN
    DISTINCTCOUNT ( 'Query 1'[Link ID] ) / SUMX ( summary, [DC LID] )

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

2 REPLIES 2
v-shex-msft
Community Support
Community Support

Hi @BalaKiranM,

I'd like to suggest you add a variable with summarize function to aggregate these ID at first, then you can simply summary these results to calculate with current id:

% Link ID =
VAR summary =
    SUMMARIZE (
        ALLSELECTED ( 'Query 1' ),
        [Category],
        "DC LID", DISTINCTCOUNT ( 'Query 1'[Link ID] )
    )
RETURN
    DISTINCTCOUNT ( 'Query 1'[Link ID] ) / SUMX ( summary, [DC LID] )

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
amitchandak
Super User
Super User

@BalaKiranM , Try a measure like

 

% Link ID = divide( DISTINCTCOUNT('Query 1'[Link ID]), calculate( DISTINCTCOUNT('Query 1'[Link ID]), allselected())

 

https://learn.microsoft.com/en-us/dax/allselected-function-dax

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.

Top Solution Authors