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
shikhar6339
New Member

I need to return a value for a particular row and column

Below is my data. I need to create a measure which will return a value of Germany on 20211211 i.e. 81. What will be the formula for that measure?

 

Country2021121020211211202112122021121320211214202112152021121620211217202112182021121920211220
USA2490496090856690357583
Germany1981524912467176674686
India7266644025823456574277
Greece1365428837745811835240
UAE2828298133282440275574
Australia7067235882573165235164
New Zealand6179292140477143821480
Zimbabwe1921724816837829893812
South Africa4880151331315636131636
Russia52693844804912385156

29

 

5 REPLIES 5
smpa01
Super User
Super User

@shikhar6339 unpivoting first step

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs
parry2k
Super User
Super User

@shikhar6339 solution I suggested is the way to go, if you have more columns, just select all those columns except date column and then unpivot it.

 

Follow us on LinkedIn

 

Learn about conditional formatting at Microsoft Reactor

My latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

shikhar6339
New Member

Thanks you for the solution. But the table I have mentioned above is just a sample table. Exactly what I have is a data of covid cases of 130 countries for 1.5 years with dates as column names and country names as rows and covid cases as field values.

 

What I am looking for is a measure where it will return a particular value of cases (for eg: I want to see what were the total covid cases of India on 31st July 2021). I want 2 measures of similar type because I want to use them in KPI visual later on.

 

Please suggest any solution for this situation.

Hi @shikhar6339 ,

 

Power BI can not filter columns but rows. The method parry2k mentioned is what we usually do to filter columns. Don't worry, the power query can have up to 16384 columns. If you still feel unsure, you can transpose first. Then unpivot columns.

steps:

Use headers as first row -> transpose -> use first row as headers -> select first column -> right click and unpivot other columns.

vchenwuzmsft_1-1640242644541.pngvchenwuzmsft_2-1640242704227.png

Then on the page you can just use a simple measure  = sum(table[value]) in a card show the result

vchenwuzmsft_3-1640243333242.png

 

Pbix in the end you can refer.

Best Regards

Community Support Team _ chenwu zhu

 

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

 

parry2k
Super User
Super User

@shikhar6339 best way is to unpivot your data and then it is straight forward

 

Transform Data -> select country column -> Right Click -> Unpivot other columns

 

you will get attribute and value columns, rename it as you see fit -> close and apply

 

In matrix visual, put country on rows, attribute (or renamed column) on columns, and value on values. Use country and attribute as a slicer and filter on any country and/or any date.

 

Follow us on LinkedIn

 

Learn about conditional formatting at Microsoft Reactor

My latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

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.