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.
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?
Country | 20211210 | 20211211 | 20211212 | 20211213 | 20211214 | 20211215 | 20211216 | 20211217 | 20211218 | 20211219 | 20211220 |
USA | 24 | 90 | 49 | 60 | 90 | 85 | 66 | 90 | 35 | 75 | 83 |
Germany | 19 | 81 | 52 | 49 | 12 | 46 | 71 | 76 | 67 | 46 | 86 |
India | 72 | 66 | 64 | 40 | 25 | 82 | 34 | 56 | 57 | 42 | 77 |
Greece | 13 | 65 | 42 | 88 | 37 | 74 | 58 | 11 | 83 | 52 | 40 |
UAE | 28 | 28 | 29 | 81 | 33 | 28 | 24 | 40 | 27 | 55 | 74 |
Australia | 70 | 67 | 23 | 58 | 82 | 57 | 31 | 65 | 23 | 51 | 64 |
New Zealand | 61 | 79 | 29 | 21 | 40 | 47 | 71 | 43 | 82 | 14 | 80 |
Zimbabwe | 19 | 21 | 72 | 48 | 16 | 83 | 78 | 29 | 89 | 38 | 12 |
South Africa | 48 | 80 | 15 | 13 | 31 | 31 | 56 | 36 | 13 | 16 | 36 |
Russia | 52 | 69 | 38 | 44 | 80 | 49 | 12 | 38 | 51 | 56 | 29
|
@shikhar6339 unpivoting first step
@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.
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.
Then on the page you can just use a simple measure = sum(table[value]) in a card show the result
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.
@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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
104 | |
95 | |
80 | |
67 | |
62 |
User | Count |
---|---|
138 | |
107 | |
104 | |
82 | |
63 |