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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.