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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

How to get following SQL expression in DAX?

Hi, 


So I have an SQL measure:

 

COUNT([LteRsrp]) / TOTAL(COUNT([LteRsrp]))

 

it is used to get a bar chart in Tableau, but when I use following DAX in POWER BI:

 

DIVIDE(COUNT([LteRsrp]),CALCULATE(COUNT[LteRsrp]),ALL(TABLE))

 

It actually gives me half the values in Power BI as compared to Tableau. 

 

Can anybody tell me what is the problem here?

4 REPLIES 4
v-yalanwu-msft
Community Support
Community Support

Hi, @Anonymous ;


Is the above answer helpful to you? If so, Would you mind accept the helpful replies as solutions? Then we are able to close the thread. More people who have the same requirement will find the solution quickly and benefit here. Thank you.

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

v-yalanwu-msft
Community Support
Community Support

Hi, @Anonymous ;

If the data is inconsistent in power BI and Tableau, it may be filtered, please try it.

Measure =
DIVIDE (
    CALCULATE (
        COUNT ( [LteRsrp] ),
        FILTER ( ALL ( 'Table' ), [LteRsrp] = MAX ( [LteRsrp] ) )
    ),
    CALCULATE ( COUNT ( [LteRsrp] ), ALL ( 'Table' ) )
)

The final output is shown below:

vyalanwumsft_0-1628058600863.png

 

If not, can you share more pictures about your data after removing sensitive information?

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Fowmy
Super User
Super User

@Anonymous 

Try this one, please?

Not sure about the columns of your table in the example, better share the screenshot of the measure

tp_test =
DIVIDE (
    COUNT ( Tablename[LteRsrp] ),
    CALCULATE ( COUNT ( Tablename[LteRsrp] ), ALLSELECTED ( Tablename ) )
)

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

Here: 

armughan_0-1627906271136.png

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.