Forum Discussion

kevbrown1980's avatar
kevbrown1980
Frequent Visitor
10 months ago
Solved

Qlik Calculation in Power BI

Hi

 

I'm creating a dashboard in Power BI which was originally in Qlik and can't work out how to do a calculation, I'm hoping someone can help. How can the following calculation be put into Power BI?

 

= (sum({<[Hospital] = {'L'},
[inc_hrgcode]={
'NZ30A',
'NZ30B',
'NZ30C'
>} inc_priceactual) 
 
+
 
sum({<[Hospital] = {'B'},
[inc_report_group_2]={'Maternity Pathway'},
[inc_poddesc]={'Maternity Pathway Intrapartum (Births)','MATINTRA'}
>} inc_priceactual) 
 
)
  • Hi kevbrown1980  - added twofilter conditions, with L and B.

    you can replace with right table name: 

     

    Hope it helps:

     

    Create a measure in Power BI as follows:

     

    Total Price Actual = 
    VAR Hospital_L_Sum =
    CALCULATE(
    SUM('YourTable'[inc_priceactual]),
    'YourTable'[Hospital] = "L",
    'YourTable'[inc_hrgcode] IN {"NZ30A", "NZ30B", "NZ30C"}
    )

    VAR Hospital_B_Sum =
    CALCULATE(
    SUM('YourTable'[inc_priceactual]),
    'YourTable'[Hospital] = "B",
    'YourTable'[inc_report_group_2] = "Maternity Pathway",
    'YourTable'[inc_poddesc] IN {"Maternity Pathway Intrapartum (Births)", "MATINTRA"}
    )

    RETURN
    Hospital_L_Sum + Hospital_B_Sum

3 Replies

  • Hi kevbrown1980  - added twofilter conditions, with L and B.

    you can replace with right table name: 

     

    Hope it helps:

     

    Create a measure in Power BI as follows:

     

    Total Price Actual = 
    VAR Hospital_L_Sum =
    CALCULATE(
    SUM('YourTable'[inc_priceactual]),
    'YourTable'[Hospital] = "L",
    'YourTable'[inc_hrgcode] IN {"NZ30A", "NZ30B", "NZ30C"}
    )

    VAR Hospital_B_Sum =
    CALCULATE(
    SUM('YourTable'[inc_priceactual]),
    'YourTable'[Hospital] = "B",
    'YourTable'[inc_report_group_2] = "Maternity Pathway",
    'YourTable'[inc_poddesc] IN {"Maternity Pathway Intrapartum (Births)", "MATINTRA"}
    )

    RETURN
    Hospital_L_Sum + Hospital_B_Sum

  • v-venuppu's avatar
    v-venuppu
    Icon for Community Support rankCommunity Support

    Hi kevbrown1980 ,

    Thank you for reaching out to Microsoft Fabric Community.

    Thank you rajendraongole1 for the prompt response.

    I wanted to check if you had the opportunity to review the information provided and resolve the issue..?Please let us know if you need any further assistance.We are happy to help.

    Thank you.

  • v-venuppu's avatar
    v-venuppu
    Icon for Community Support rankCommunity Support

    Hi kevbrown1980 ,

    May I ask if you have resolved this issue? Please let us know if you have any further issues, we are happy to help.

    Thank you.