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.
Hi All,
Looking for advice, I have a table with State based Sales and a number of other attributes. I have used SUMMARIZECOLUMNS to give me National Sales in a new table. I want to use this in my original data to calculate % STATE / NATIONAL for each row. I need to use all the attributes as filters on the new measure at the State Level. I am not sure what the next step should be. Can this be solved in DAX?
Thanks
National Data - comes from new table where.
Country YTD Data= SUMMARIZECOLUMNS(TableName[Month],TableName[Year],TableName[Country],TableName[AttributeA],TableName[AttributeB], ,"CountryYTDNumber",[YTD Number])
TableName is the state level detail.
Solved! Go to Solution.
Hi @AllyOops ,
You could create two columns as below.
Column = LOOKUPVALUE('Table (2)'[Australia YTD Sales],'Table (2)'[Product Attribute A],'Table'[Product Attribute A])
Column 2 = 'Table'[DATA YTD Sales]/'Table'[Column]
Result would be shown as below.
Best Regards,
Jay
Hi @AllyOops ,
You could create two columns as below.
Column = LOOKUPVALUE('Table (2)'[Australia YTD Sales],'Table (2)'[Product Attribute A],'Table'[Product Attribute A])
Column 2 = 'Table'[DATA YTD Sales]/'Table'[Column]
Result would be shown as below.
Best Regards,
Jay
@AllyOops ,The information you have provided is not making the problem clear to me. Can you please explain with an example.
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
Appreciate your Kudos.
@Amit Thanks for your interest. I have tried a number of ways through adding custom column direct to Table 1 but no luck. I seem to only get the out put as a new table which works fine as a single calculation but I am not sure what approach to take to bring the 2 tables back together again.
Following is my data.
Source Table (Table1)
Year | Month | Region | Country | State | Customer Sector | Customer Type A | Product Attribute A | DATA YTD Sales |
2019 | Apr | Oceania | Australia | NSW | Private | HE | Apple | 150 |
2019 | Apr | Oceania | Australia | SA | Private | VE | Orange | 50 |
2019 | Apr | Oceania | Australia | QLD | Government | ST | Grapes | 99 |
2019 | Apr | Oceania | Australia | VIC | Private | HE | Apple | 200 |
2019 | Apr | Oceania | Australia | TAS | Private | VE | Orange | 75 |
2019 | Apr | Oceania | Australia | WA | Government | ST | Grapes | 60 |
SUMMARIZECOLUMNS -> New Table
Year | Month | Country | Customer Type A | Product Attribute A | Australia YTD Sales |
2019 | Apr | Australia | HE | Apple | 350 |
2019 | Apr | Australia | VE | Orange | 125 |
2019 | Apr | Australia | ST | Grapes | 159 |
Aiming for this.
Year | Month | Region | Country | State | Customer Sector | Customer Type A | Product Attribute A | DATA YTD Sales | Australia YTD Sales | Planned Measure |
2019 | Apr | Oceania | Australia | NSW | Private | HE | Apple | 150 | 350 | 43% |
2019 | Apr | Oceania | Australia | SA | Private | VE | Orange | 50 | 125 | 40% |
2019 | Apr | Oceania | Australia | QLD | Government | ST | Grapes | 99 | 159 | 62% |
2019 | Apr | Oceania | Australia | VIC | Private | HE | Apple | 200 | 350 | 57% |
2019 | Apr | Oceania | Australia | TAS | Private | VE | Orange | 75 | 125 | 60% |
2019 | Apr | Oceania | Australia | WA | Government | ST | Grapes | 60 | 159 | 38% |
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 |
---|---|
112 | |
99 | |
73 | |
72 | |
49 |
User | Count |
---|---|
145 | |
109 | |
109 | |
90 | |
64 |