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.
I'm trying to figure out the DAX code to measure or create column showing only the highlighted .
I have repeated same value of amount converted and SFDC number. I will need the value to be measured or calculated only once, shown in the attach image below. What is the best approach for this ?
Manually deleting row by row will be very cumbersome or is there are DAX code to delete repeated SFDC number or amount converted ?
My SFDC number in this Winson_test file will be the unique identifier or relationship joint to my other source.
My main objective is to have a chart showing : Amount converted vs Quarter with it's respective Product Line as the legend.
The source file is from Slaesforce Report. The attach image below is just an ilustration of a partial content after extracted from Salesforce Report.
@Anonymous,
Show us a complete example and the expected output.
Hi @BDA2,
From a Salesforce perspective, it seems you are pulling data from a report built based on "opportunity + quotes" or similar.
If this is the case, that is why you see 2 fields that can not be compared directly, "Product line" and "Amount converted".
"Product line" makes sense at quote level (not at opportunity header level), the relatinship is one to many, one record (opportunity) to one quote with many products (with different "Product line").
If that's the case, "amount converted" is calculated at opportunity header level, it is a total that is a single value and calculates the sum of all prodcuts in the quote, it will be the same value for all products.
Some options (4):
a) If you need "Product line" or any other information at Quote level, you can use a converted Amount at quote level and pull that to Power BI
b) you can create a formula field in SFDC to calculate the "Amount Converted" for each "Product line" and use those precalculated fields in Power BI
c) If you do not need "Product line", you can build the SFDC reporte starting from "opportunity" instead of "Opportunity and quotes"
d) In Power BI query editor you can remove the column Product line and apply a step to remove duplcated rows
Pablo
Hi @Anonymous
Can you confirm that the relationship is many to many?
If it is many to many, then you can have one opportunity wiith MANY quotes (and products under each quote), and a given quote can be linked to MANY opportunity.
If you have one opportunity with many quotes and a quote can be linked to a single opportunity, the relationship is one to many.
To pull data directly from Salesforce object may be the best approach, but if you need the ammount converted, that may not BE available directly from Salesforce object, you may need a formula field.
If you can work without multicurrency, you can import all the objects to Power BI (Opportunity, quotes, products linked to quotes) and in Power BI query build the relation and create a sum based on ammount at "product quote" level.
This may not be a DAX problem, the details imported are at opportunity header level, but you need the values at product line level and DAX will not be able to split it.
Regards
Pablo
Hi @Anonymous,
Follow below steps:
Create a measure to calculate Max of Amount per Unique ID:
MaxAmount = MAX(Test[Amount])
Then Create a measure to sum the distinct amounts:
ActualAmount = SUMX(DISTINCT(Test[ID]),[MaxAmount])
Use this Actual Amount in your table to get correct Totals.
If you want to further understand how above DAX works, see this video.
Prateek Raina
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 |
---|---|
110 | |
95 | |
76 | |
65 | |
51 |
User | Count |
---|---|
146 | |
109 | |
106 | |
88 | |
61 |