How to show only the above the price of average Prices? - sorting

I am stuck at a problem where I don't understand how to filter all the prices that are above average. Here is a picture of the names and prices:
I believe that I have to do this in the Design View, but I have no clue on how to start.

You can use DAvg in your query:
SELECT
Products.[Product Name],
Products.[List Price]
FROM
Products
WHERE
Products.[List Price] > DAvg("[List Price]","[Products]");

Related

Deactivating a filter applied to a card in POWER BI

Rank Turnover =
RANKX(
ALL(Regions[Region]),
CALCULATE([Sales Total],KEEPFILTERS(Sales[Currency]="EUR"))
)
Hi everyone, got stuck with this one for the second day in a row. There are 3 tables in a dataset (Regions, Sales and Currency). Regions and Currency are filtering out the Dashboard when applied. My Intention is to have Total Sales in a Card for EUR only for a Chosen in a Region Filter Country. Everything works fine, but whenever I choose "LC" (Local Currency) in Currency Filter, the numbers Change - I Need to overcome that. Changing LC in that Filter should not affect Total Sales, they have to still be done in EUR.
Any help will be appreciated,
Thank you
Rank Sales EUR =
RANKX(
ALL(Regions[Region]),
CALCULATETABLE(
{[Sales Total]},
TREATAS({"EUR"}, 'Dashboard Currency'[Currency]),FILTER(Dates, Dates[Year]=MAX([Year]))))
Here is the answer. Thank you all for support

dax handling summary values in a matrix report

Source data columns are Store, Product, StoreSales, and ProductSales
StoreSales has duplicate values, even across different Stores.
Looking for a dax measure to handle StoreSales as described in the image.
This is the closest so far, but doesn't account for duplicates between stores.
Store Sales:=
sumx(DISTINCT(_Sales[StoreSales), _Sales[StoreSales])
screenshot of source and pivot table
To answer your question directly, this formula should give you the desired result:
Desired Result for Store Sales =
IF(ISFILTERED(_Sales[Store]), SUM(_Store[Store Sales]))
However, I recommend to revisit your data model design. It's conceptually incorrect (you are mixing detailed data with the summary of the same data), and you will have serious problems with DAX. A better way to structure your data:
Remove column "Store Sales". It's redundant and does not fit the data level of detail.
Rename column "Product Sales" into "Sale Amount". It's just sale amount, without any qualifiers.
Create a measure "Total Sales" = SUM(_Sales[Sale Amount]). It will correctly calculate total sales both on product and store levels.
If you need a special measure for store sales, use SUMX:
Store-level sales = SUMX (VALUES(_Sales[Store]), [Total Sales])
And if you need to show product contributions to store sales:
Product Contribution = `DIVIDE([Total Sales], [Store-Level Sales])

ImportXML with flexible conditions

I have to fetch the price of Lego items
http://mightyutan.com.my/batman-movie/?id_category=1413&n=100
But the challenges here are the price are split into two conditions
No discount, reflect regular price
With discount, show discounted price
How could I use ImportXML for my column to display discounted price, else regular price? I only know to capture a fixed xpath pattern
//div[#class='content_price']/span[#class='price'][1]
Also, I have display the title of the Lego set, for due to the items with no discount, total rows return from my title and price are not tally
Thanks for the help
try this if you want to use include class:
//*[contains(#class,'product-block-inner')]//span[contains(#class,'price')][last()]
or better this when you are sure class won't be changed:
//*[#class = 'product-block']//span[#class='price'][last()]
as discount is located after initial price - just get last price element for product, so it will be discount or if it's not available - initial price =)

Top N by Total Sales in Year X Filter Tableau

How to place a filter in my worksheet that filters a category by top sales in a certain year while still showing all years of data for that category.
Does anyone have an idea how to do this?
One solution is to create a calculated field called Sales_In_Selected_Year that returns the sales for the year you care about and null otherwise such as:
if Year = Selected_Year then Sales end
Place Sales_In_Selected_Year on the filter shelf wth a Top filter and use the original Sales field as desired. Selected_Year can be a parameter for flexibility.

Sort Report table by totals

I have built a report with a table. It looks very much like the table in the following link (last figure, before "Next Steps").
Microsoft Tutorial: Adding grouping and totals
I have turnover values for products which are grouped by subcategories and categories and have a total for subcategories and categories. I want to sort the table by turnover (in the example it is "line total"). I can do that for the single product values in a subcategory, but not for the totals. Is that possible?
For all people interested: the row groups can be sorted by themselves (in Row Group - Group Properties). As the sort expression, one has just to choose SUM(Fields.LineTotal.Value).

Resources