Forum Discussion

Rami_Aziz's avatar
Rami_Aziz
Helper I
3 years ago
Solved

Use two Measure as Category

Hi Guys,

 

I need help with my work requirment 

 

I did create two measures (Emplyment Expenses current year Dec-21)  &  (Employment Expenses Prior Year  Dec-20) and i need to show them as catgory , so both will be showen under emplyment expenses 

 

 

 

is there any way to built a table or a visual 

 

thank you 

  • Hi , Rami_Aziz 

    According to your description, you want to "Use two Measure as Category".

    Here are the steps you can refer to :
    (1)This  is my test data:

    (2)I create two measure to imitate yours.

     

    We can create a new Table as a Lengend in the new visual :

    We do not need to make any relationship between two tables.

     

    (3)We can create a measure like this:

    Measure = var _cur_len = MAX('Table 2'[Column1])
    return
    IF(_cur_len = 2022 , [2022 Measure] , [2023 Measure])

     

    Then we can put the fields we need on the visual and we can meet your need , the reuslt is as follows:

     

     

     

     

    If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem. (You can also upload you sample .pbix [without sensitive data] to the OneDrive and share with the OneDrive link to me ! )

    Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

     

    Best Regards,

    Aniya Zhang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

     

1 Reply

  • Hi , Rami_Aziz 

    According to your description, you want to "Use two Measure as Category".

    Here are the steps you can refer to :
    (1)This  is my test data:

    (2)I create two measure to imitate yours.

     

    We can create a new Table as a Lengend in the new visual :

    We do not need to make any relationship between two tables.

     

    (3)We can create a measure like this:

    Measure = var _cur_len = MAX('Table 2'[Column1])
    return
    IF(_cur_len = 2022 , [2022 Measure] , [2023 Measure])

     

    Then we can put the fields we need on the visual and we can meet your need , the reuslt is as follows:

     

     

     

     

    If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem. (You can also upload you sample .pbix [without sensitive data] to the OneDrive and share with the OneDrive link to me ! )

    Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

     

    Best Regards,

    Aniya Zhang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly