Forum Discussion
DAX query to Filter two duplicate columns independently using Measure table approach
Hi All,
I want to implement a feature like column filter in PowerBI matrix visualization. After checking lot of articles , I came to know that there is no direct visulization for column filter so let me explain my approach and scenario.I have a table say Sales with Quateryear, SalesAmount-A and SalesAmount-B as column names.I want to show the Sum of sales per Quateryear selection value in the filter.
I created two tables with the values contained in filter as shown below.These tables are not related to the main table and are kept independent as I dont want one filter selection to affect the other one since both have the same field values and refer to duplicate columns.I want to implement this using parameter approach.If anyone has any better approach please let me know :-
Present visualization:-
Input source [excel]
| QuaterYear | SalesAmount-A | SalesAmount-B | Place |
| Q12017 | 1000 | 1000 | London |
| Q12017 | 1100 | 1100 | London |
| Q12017 | 1120 | 1120 | London |
| Q12017 | 900 | 900 | Tokyo |
| Q22017 | 2200 | 2200 | Tokyo |
| Q22017 | 2100 | 2100 | Tokyo |
| Q22017 | 1000 | 1000 | Tokyo |
| Q22017 | 500 | 500 | Tokyo |
| Q22017 | 1900 | 1900 | Tokyo |
| Q22017 | 1900 | 1900 | Tokyo |
| Q22017 | 2000 | 2000 | Tokyo |
| Q22017 | 4000 | 4000 | Tokyo |
| Q22017 | 2100 | 2100 | Tokyo |
| Q32017 | 1100 | 1100 | Kaula Lampur |
| Q32017 | 890 | 890 | Kaula Lampur |
| Q42017 | 2200 | 2200 | Berlin |
| Q42017 | 2300 | 2300 | Berlin |
| Q42017 | 2900 | 2900 | Berlin |
I am using the functions for ParamTable1 and ParamTable2:
1 Reply
- parry2k
Super User
deb_power123 if I understood correctly, try thee two measures:
Measure Sales A = CALCULATE ( [TotalSalesA], TREATAS ( VALUES ( ParamTable1[P1] ), Sales[QuarterYear] ) ) Measure Sales B = CALCULATE ( [TotalSalesB], TREATAS ( VALUES ( ParamTable2[P1] ), Sales[QuarterYear] ) )Check my latest blog post Compare Budgeted Scenarios vs. Actuals 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.⚡