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

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
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.