The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hello Everyone
I need the DAX measure expression for the below scenario.
For my table Sales, I have 4 columns-Quateryear, SalesAmount-A, SalesAmount-B,Place.
Both the column values of SalesAmount-A and SalesAmount-B are same and they have filters A and filter B applied on SalesAmount-A and SalesAmount-B respectively. filter A and filter B has Quateryear values.
so as per my requirement if I select any quateryear value in filterA, it should filter and sum the Sales AmountA and if it select any quateryear value in filter B, it should filter and sum the SalesAmountB. Based on these filtered values selection, I should get the difference between SalesAmount -A and Sales Amount-B columns in the DifferenceSales
P.S: Here the column values for SalesAmount-A, SalesAmount-B are the same/you can say duplicate column. The filters too refers to the same column quateryear.
I wrote a measure to handle this but it is not working.
Could someone suggest some changes.
QuaterYear | SalesAmount-A | SalesAmount-B | Place | DifferenceSales |
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 |
Expected Output in PowerBI should look like this:[Just for look and feel I made a similar in excel as below]
My Sales Matrix table visualization :
Where is the Tokyo value for Q12017?
You probably need to duplicate your data table, and use one copy for the A filter and the other copy for the B filter. Then use a measure to calculate the difference between the selected items. You will need to lower your expectations on the output format, it is not possible to implement it exactly as in your example.
User | Count |
---|---|
17 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
26 | |
13 | |
12 | |
9 | |
8 |