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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
hashmi1977
Frequent Visitor

How to use Measure to calculate yes and no in column

 
Need to calculate yes and no in columns by using measure or any other method

Here is the actual table view:

hashmi1977_3-1714575036421.png

Where we need Power Bi output like this:

 

hashmi1977_4-1714575080062.png

 

 

 

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

Hi @hashmi1977

 

@DataNinja777 Thank you very much for your prompt reply. I think your response is appropriate.

 

I found your post while reviewing the forum posts. May I ask if your problem has been solved?

 

If you still have questions, here I explain some of them to you.

 

With unpivot you are not generating a new table, you are converting the data that was in the rows, to data in the columns.

 

You can view the link below for more details:

 

Unpivot columns - Power Query | Microsoft Learn

 

For the table in the screenshot, you need to manually create a matrix visualization object.

 

vnuocmsft_1-1715937081996.png

 

vnuocmsft_0-1715937051821.png

 

Regards, 

Nono Chen 

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

3 REPLIES 3
v-nuoc-msft
Community Support
Community Support

Hi @hashmi1977

 

@DataNinja777 Thank you very much for your prompt reply. I think your response is appropriate.

 

I found your post while reviewing the forum posts. May I ask if your problem has been solved?

 

If you still have questions, here I explain some of them to you.

 

With unpivot you are not generating a new table, you are converting the data that was in the rows, to data in the columns.

 

You can view the link below for more details:

 

Unpivot columns - Power Query | Microsoft Learn

 

For the table in the screenshot, you need to manually create a matrix visualization object.

 

vnuocmsft_1-1715937081996.png

 

vnuocmsft_0-1715937051821.png

 

Regards, 

Nono Chen 

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

 

DataNinja777
Super User
Super User

Hi @hashmi1977 

 

You can achieve your required output in many ways, but one example is to use the unpivot and countrows, as shown in the example below.  (Sorry the order of the field is in alphabetical order and do not match with your example.)  

 

DataNinja777_0-1714576789553.png

I attach the pbix file as an example.  

I have a sharepiont list as table and When I tried to "Unpivot Only Selected Columns" then it is not creating seperate table as I can see in your screenshot. it is unpivot rows in the same dateaset which means rows increased by (No of rows * unpivot columns)

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.