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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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

4 REPLIES 4
Bhavana_HR
Frequent Visitor

Hi Experts,

 

Can anyone please help me in converting the below mentioned Qlik formula to power bi DAX formula

 

If( if(Year=2013,avg([Act Scrap % of Rev.]),(Sum([Act Scrap % of Rev.])/sum(if(Year>='2017',[Act_Revenue_Scrap] * [Average Rate],[Act_Revenue_Scrap]))))<>0,

if(Year=2013,avg([Act Scrap % of Rev.]),(sum(if(Year>='2017',if(Act_Revenue_Scrap<>'0',[Act. Scrap $] * [Average Rate]),if(Act_Revenue_Scrap<>'0',[Act. Scrap $])))
/sum(if(Year>='2017',[Act_Revenue_Scrap] * [Average Rate],[Act_Revenue_Scrap])))),

null()

)

 

Thank you

Anonymous
Not applicable

Hi MDX Experts,

Could you convert below query to DAX .This will be very helpful 🙂

 

=if('$(vWHELocation)' = 'TWI-WH',
num(aggr(sum(if([opratwarehousewithexpiry.Bin Code] <> 'SHIPBIN',
[opratwarehousewithexpiry.Remaining Quantity])),Items.No_,[opratwarehousewithexpiry.Expiration Date]))
,
num(aggr(sum([polandwarehousewithexpiry.Remaining Quantity]),Items.No_,[polandwarehousewithexpiry.Expiration Date])))

 

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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