cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Qlik Expression to DAX

HI experts,

 

Can anyone help me to convert the below Qlik Experssion to DAX. It will be great help. The highlighted Yellow one are the varaibles and explanation for the varaibles are also marked below.

Thank you!

Qliktodax1.PNG

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

Hi @Anonymous,

You can try to use the following expressions if they are suitable for your requirement:

Measure1 =
VAR currDate =
    MAX ( Table[Date] )
VAR scaleMil =
    SELECTEDVALUE ( Table[scaleMil] )
VAR lable =
    SELECTEDVALUE ( Table[scaleMillable] )
RETURN
    FORMAT (
        INT (
            SUMX (
                FILTER (
                    Table,
                    YEAR ( [Date] ) = YEAR ( currDate )
                        && MONTH ( [Date] ) = MONTH ( currDate )
                ),
                [Blance] * [ActualFlag] * [ExchgRate]
            ) / scaleMil
        ),
        "$#,##0.0"
    ) & lable

Measure2 =
IF (
    COUNTROWS ( ALLSELECTED ( Table[Column1] ) ) = 1
        || COUNTROWS ( ALLSELECTED ( Table[Column2] ) ) = 1,
    1000000,
    1000000000
)

Measure3 =
IF (
    COUNTROWS ( ALLSELECTED ( Table[Column1] ) ) = 1
        || COUNTROWS ( ALLSELECTED ( Table[Column2] ) ) = 1,
    "Mn",
    "Bn"
)

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

You can try to use the following expressions if they are suitable for your requirement:

Measure1 =
VAR currDate =
    MAX ( Table[Date] )
VAR scaleMil =
    SELECTEDVALUE ( Table[scaleMil] )
VAR lable =
    SELECTEDVALUE ( Table[scaleMillable] )
RETURN
    FORMAT (
        INT (
            SUMX (
                FILTER (
                    Table,
                    YEAR ( [Date] ) = YEAR ( currDate )
                        && MONTH ( [Date] ) = MONTH ( currDate )
                ),
                [Blance] * [ActualFlag] * [ExchgRate]
            ) / scaleMil
        ),
        "$#,##0.0"
    ) & lable

Measure2 =
IF (
    COUNTROWS ( ALLSELECTED ( Table[Column1] ) ) = 1
        || COUNTROWS ( ALLSELECTED ( Table[Column2] ) ) = 1,
    1000000,
    1000000000
)

Measure3 =
IF (
    COUNTROWS ( ALLSELECTED ( Table[Column1] ) ) = 1
        || COUNTROWS ( ALLSELECTED ( Table[Column2] ) ) = 1,
    "Mn",
    "Bn"
)

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

amitchandak
Super User
Super User

@Anonymous , We might not be a Qlik expert. So please provide the requirement.

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! !!
Dashboard of My Blogs !! Connect on Linkedin

Learn Power BI Beginners !! Advance Power BI Concepts !! Power BI For Tableau User !! Learn Power BI in Hindi !!
Proud to be a Super User!

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

November Power BI Update 768x460.png

Check it Out!

Click here to read more about the November 2021 Updates!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.