Power BI - How do I get the Status correct based on the columns I add or remove - count

Am stuck in a situation that I cant seem to solve, still learning so would appreciate if you could tell me what am I doing wrong and how do I get this right? It seems simple, but not for me anymore.
Background:
ACME company sells products in various cities and I need to check if ACME is Cheaper, Same or Expensive in terms of pricing. The same product may be sold in 10 different stores in a city and we want to know:
How is ACME doing for each product by City or by Store and I
calculate that as follows:
For each City:
List all the instances of that one product (lets say that product was sold in 10 stores in Dallas,so 10 instances,which means we may have 10 different store prices
Then return the minimum price of these 10 prices
Compare this minimum price against the ACME price and determine whether the product is Cheap, Same or Expensive
Formula:
Measure to calculate min price = 1 Min Price = CALCULATE(MINX(Data,Data[Store Price]),ALLEXCEPT(Data,Data[Barcode],Data[City],Data[Match Type],Data[Store]))
Calculated Column to detrmine status = 2 Price Status = if(Data[ACME Price]<[1 Min Price],"Cheap",if(Data[ACME Price]=[1 Min Price],"Equal","Expensive"))
Problem to be solved:
Screenshot 1 - When i have stores listed along with City, then the formula should consider the Store column and give me minimum price per Store (basically it will do a row by row comparison as a a store will show only once per city) which is what its doing in the "Min Price" and also the status is correct
Screenshot 1 - With Stores
[
Screenshot 2 - When I remove stores, the "Min Price" column is showing the right minimum price for a product per city, however the Status is incorrect - for product ending 7572, both the status must be Equal and for product ending 3566, it should be Expensive
Screenshot 2 - Without Stores
Can someone please advise what am I doing wrong? How do i get the status right when viewing by City?

Related

WooCommerce Ignores Country Change During Checkout Process

Context
A seller is from one and only one country (M). An end user wants to purchase membership which costs 500 EUR.
It appears that the seller's country (M) is taken as a reference when calculating taxes not only for country M but also for all other countries. In this example, I defined two countries and their different tax rates.
Tax for country M is 9%, and when I select it, then the system spits out "500 EUR (incl. 41,28 € tax)"
41,28 € is 9% of 500.
However, if during the checkout I select "country C" then the system spits out "555,05 € (incl 96,33 € tax".
The way THIS is calculated is by taking a non-tax amount from country M 458,72 EUR (500 - 41,28) and adding to it tax amount defined for country C (21 %).
458,72 EUR x 1,21 = 555 EUR.
(This does not make sense. The user changed the country during checkout process, but the system ignores it).
This way, what is defined as the package price, changes constantly (as example above instead of 500 EUR it shows 555 EUR as the total price)
The way it SHOULD be calculated based on my opinion is: when a user during the checkout selects country C the full amount defined for the entire package (500 EUR) and defined tax rate for the selected country (country C = 21 %) should be taken to calculate the tax amount.
I would expect the result: "500 € incl 86,77 € tax."
(86,77 is 21% of 413,22 EUR)
Question:
Why is WooCommerce not refreshing country during the checkout when a user selects a country different from store country?
How can I setup this functionality with WooCommerce?
Target functionality is to define membership packages for everyone independent of countries. And all users should see (and pay) the same price.
But when a user from country M goes through the checkout process then in reference to the total price the tax should be calculated. Same should work for any other country.

How to determine trial booking conversion - google sheets

Introduction
Many sites use WooCommerce as a plugin for their WordPress site and so do we :). We've linked all purchases to google sheets, so I can do some analyses.
Our goal is get a many children physically active as we can and we have gym classes for very young children with they parents. To teach them the basics of the fun of physical activity
What I would like to do
I would like to know, how many free trial classes actually convert to paying customers and what the average timespan is between booking a trial class and becoming a member
The data that I have
I have the following columns which are necessary for this, I believe:
Datestamp
paymentID (is empty when booking a free trial class)
Price (is 0,00 whem booking a free trial class)
childsName (Unique in combination with parentsEmailadress, but recurs every month in the list once a membership is active)
parentsEmailadress (may have several children)
OrderName (has the string "trial" or "Membership")
I've made some dummy data in the following sheet:
https://docs.google.com/spreadsheets/d/1lWzQbXMU4qRLp_2qiQ_qsq57nPMy2RG8AHDMGKW626E/edit?usp=sharing
Possible solution
My guess is that I should:
make a column in which I combine the childs name and the emailadress
Make a TRUE of FALSE column to check if order is trial class or not
Make a column to find the first Unique child-emailadres combination in previous orders (How do I do that?! - Vlookup?)
and than
if this is found than check again if this is a trial class order.
If it is a trial class order than it should determine the amount of days between the trial class order and the non-trial class order and display the amount of days
if this is another normal order than leave empty(it's just a membership order)
if the emailadres is not found than display "direct" (it's a directly bought membership)
I did 1 and 2 and tried 3 with:
=ALS(H2=0;VERT.ZOEKEN(G2;A:G;1;ONWAAR);) (in Dutch)
=IF(H2=0;V.LOOKUP(G2;A:G;1;FALSE);) (possible translation)
But this doesn't work.
Really hope some can point me in the right direction!
Thank you very much in advance!
Given that trial classes have a price of 0, there's no need to create another column to identify those cases–just check the price. To the source data we'll add the "Client ID" column that you created in Column G of your sample sheet. (Ideally, you'll come up with an client ID system, but this works.) Now, create a new sheet that will be your dashboard and let's add a few columns:
Client ID This grabs only the unique values from the Client IDs in Sheet2 as we don't want users to be repeated in our dashboard. (Column A, row 1... for all others place the formulas in row 2).
=UNIQUE(Sheet2!G:G)
Did they trial? This will tell you TRUE/FALSE if the client did a trial. (Column B).
=ISNUMBER(MATCH(Dashboard!A2, FILTER(Sheet2!G:G, Sheet2!C:C=0), 0))
Did they convert? This will tell you TRUE/FALSE if the client converted from trial to paid. (In cases where they did not do a trial, it will be blank.) (Column C).
=IF(Dashboard!B2, ISNUMBER(MATCH(Dashboard!A2, FILTER(Sheet2!$G:$G, Sheet2!$C:$C>0), 0)), "")
Date of First Trial The date of the first trial. If none exists, will be blank. (Column D).
=IFERROR(MIN(FILTER(Sheet2!$A:$A, Sheet2!$G:$G=Dashboard!A2, Sheet2!$C:$C=0)))
Date of First Paid Course The date of the first paid course. If none exists, will be blank. (Column E).
=IFERROR(MIN(FILTER(Sheet2!$A:$A, Sheet2!$G:$G=Dashboard!A2, Sheet2!$C:$C>0)))
Days from First Trial to First Paid The number of days between the first paid course and the first trial course. If one of those values doesn't exist, then will be blank. (Column F).
=IF(ISDATE(Dashboard!E2), Dashboard!E2-Dashboard!D2, "")
Now you can answer several questions:
How many clients used a free trial? =COUNTIF(Dashboard!B:B, TRUE)
How many free trials converted? =COUNTIF(Dashboard!C:C, TRUE)
Average number of days from first trial to first paid? =AVERAGE(Dashboard!F:F)

How to get the lowest price of products?

Table structure
The above Table have 10 products with various price from 3 suppliers. I need to pick the supplier who can give the lowest price.
Just i tried with MS Access 2013. I unable to get the lowest price. Your valuable guidance is much appreciate one.
SID = Supplier ID
PCODE = Product Code
Thank you very much for your time
I assume cheapest means lowest per-ml price per item
So do the following:
create a query#1 that includes the product, supplier, whatever other
fields you want in the final answer, and a calculated field of the
per-ml price.
create an aggregate query #2 on query#1, which groups by product and gives the min per_ml_price. Now you have a "table" with the cheapest price for each product.
Lastly, you want to find the data that matches the lowest price. (Inner-)Join query#2 and query#1, and output the fields you want (product, supplier, etc.)

Crystal reports, get sum for specific reocrds

In Short:
I need to get a total for customer groups + the credits - the debits in a specific date range.
In Detail:
I'm creating an invoice report for customer orders. Each Customer belongs to a group, and I need to group the invoice by customer group so I can give a total amount owed for the customer group.
So the top Group in the report is customers.group_name with the total for the group in the group header.
The second group is orders.customer_id with the total for the customer in the group header.
I have 2 parameter for the date range of orders which I use in the select expert
I have another table for credits and debits for each group.
This are the fields for the CreditDebits Table
group_name
date_
type_ (this can be either "credit" or "debit")
amount
I've linked customers.group_name with CreditsDebits.group_name in the database expert.
I also use the date range parameters for this table
Do get the credits I created a formula called "credists" like so
if {Credits_Debits.type} = "credit" then sum({Credits_Debits.amount})
But when I drop this formula on the customers.group_name header, the formula shows up as empty and the total for the group gets messed up (it becomes triple of what it should be.
What am I doing wrong?
First check Does this field CreditsDebits.group_name consists of customer name? or any different name?
Place the formula if {Credits_Debits.type} = "credit" then sum({Credits_Debits.amount}) in footer but not in header and check.

Rate issue in Trade agreement journal

I have created multiple journals for an item (suppose "item1") in AX2012 with multiple rates and different from and to date.
Like for Journal 1, From date is set as 1/12/2013 and to date is NULL and rate as 50.
for journal 2, From date is set as 7/12/2013 and to date is NULL and rate as 60.
Now, logically when selecting item in sales line form on or after 07/12/2013, I must get unit price 60. But unit price that i am getting is 50.
How to get latest price of an item, account, to, from date in sales line form?
It is valid in AX to have more than one active price record (PriceDiscTable).
In your case both 50 and 60 are valid rates, it then does the service of choosing the lesser one!
In journal 2 you should find the old rate, then apply an end date of 06/12/2013.
As this is cumbersome, it is a usual customization to auto-close prices. This could be done in the insert method of PriceDiscTable.

Resources