Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
I'm importing CRM data where a dynamic value is changed over time. This value represents the quality of a lead source as leads from that source moves down the sales funnel. I need to create a measure that identifies the most recent value, so that I can use that to multiply with new leads coming in, in order to project the sales coming from those leads. Below is an example of how the data table looks like.
2/22 A 0.05
2/21 B 0.05
2/17 C 0.05
2/16 A 0.03
2/13 B 0.07
2/10 C 0.08
Solved! Go to Solution.
This will bring in the last quality value depeding on what product is being used:
Measure = CALCULATE( SUM ( CRM[Quality] ), LASTDATE(CRM[Date ] ))
I decided to go the Power query route for this one. I tried using just DAX and just wasnt working for me. So here's what I did in Power Query ( the pbix is attached below so you can step through the applied steps(:
if [#"Date "] < [Max Product Date] then Date.AddDays( [Max Product Date], -1) else [Max of Table]
List.Dates( [#"Date "], Duration.Days( [End Date] - [#"Date "]) +1 , #duration(1,0,0,0) )
What this is doing is making sure every day is accounted for and will "bring in" the last value.
Load that in, and then write the following measure:
Total Quantity = IF( ISFILTERED('CRM (3)'[Dates]), SUM ( 'CRM (3)'[Quality] ), "Please Select a Date" )
Now, dont want to sum across days since that would not make sense ( and now that i think about it, probbaly could use lastdate, but this works too)
pbix is here:
https://1drv.ms/u/s!Amqd8ArUSwDSz0IOCvktg-arAeCk
Actually it didn't quite solve my problem.
With your suggestion I was able to report the last date a quality index was updated. So 2/22 Product A was 0.05 and Product B/C is missing so that returns a blank value.
Since I don't get an updated quality value every day I was looking for a measure that reports the most recent value for each product the last time it was reported, so that in a date interval 2/1 - 2/22 I would get this result:
Product Quality
A 0.05
B 0.05
C 0.05
I decided to go the Power query route for this one. I tried using just DAX and just wasnt working for me. So here's what I did in Power Query ( the pbix is attached below so you can step through the applied steps(:
if [#"Date "] < [Max Product Date] then Date.AddDays( [Max Product Date], -1) else [Max of Table]
List.Dates( [#"Date "], Duration.Days( [End Date] - [#"Date "]) +1 , #duration(1,0,0,0) )
What this is doing is making sure every day is accounted for and will "bring in" the last value.
Load that in, and then write the following measure:
Total Quantity = IF( ISFILTERED('CRM (3)'[Dates]), SUM ( 'CRM (3)'[Quality] ), "Please Select a Date" )
Now, dont want to sum across days since that would not make sense ( and now that i think about it, probbaly could use lastdate, but this works too)
pbix is here:
https://1drv.ms/u/s!Amqd8ArUSwDSz0IOCvktg-arAeCk
pbix download is not working anymore. Could you please provide a new link? thx!
That did it, thanks a bunch!
This will bring in the last quality value depeding on what product is being used:
Measure = CALCULATE( SUM ( CRM[Quality] ), LASTDATE(CRM[Date ] ))
Who would have thought that it is as simple as this.
Thanks for sharing!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
147 | |
85 | |
66 | |
52 | |
46 |
User | Count |
---|---|
215 | |
90 | |
83 | |
66 | |
58 |