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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Rami_Aziz
Helper I
Helper I

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 

 

 

Rami_Aziz_1-1682593447608.png

 

is there any way to built a table or a visual 

 

Rami_Aziz_0-1682593255117.png

thank you 

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

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:

vyueyunzhmsft_0-1683092695099.png

(2)I create two measure to imitate yours.

vyueyunzhmsft_1-1683092733809.png

 

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

vyueyunzhmsft_2-1683092760570.png

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:

vyueyunzhmsft_3-1683092810554.png

 

 

 

 

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

 

View solution in original post

1 REPLY 1
v-yueyunzh-msft
Community Support
Community Support

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:

vyueyunzhmsft_0-1683092695099.png

(2)I create two measure to imitate yours.

vyueyunzhmsft_1-1683092733809.png

 

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

vyueyunzhmsft_2-1683092760570.png

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:

vyueyunzhmsft_3-1683092810554.png

 

 

 

 

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

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.