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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

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

@Anonymous , 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

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

Anonymous
Not applicable

Hi @Anonymous,

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

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous,

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

amitchandak
Super User
Super User

@Anonymous , 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

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.