We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hello,
I'm in a bit of a pickle and can't figure out how to compare data values. Image for refference.
What I would like to do is to compare the names (left) with the values based upon dates. E.g.
Akrylux -124.90 - 11/10/2017 has increased by 26% on the date 2/28/2018. Just calculate a simple growth rate.
growth= (present-past)/past
And then monthly - however some months dont have data - empty. Is there a way to treat those empty months as 0? And then show current month growth as 0? With the last growth figure by its side - with the last growth date?
The picture above is a Visualation (table) with the selected fields. name - sales - date.
Thank you for inputs.
Regards,
David.
Solved! Go to Solution.
Hi @Anonymous,
Please try to add calculated columns with below DAX:
past =
LOOKUPVALUE (
Tb2[Values],
Tb2[Names], Tb2[Names],
Tb2[Dates], CALCULATE (
MAX ( Tb2[Dates] ),
FILTER ( ALLEXCEPT ( Tb2, Tb2[Names] ), Tb2[Dates] < EARLIER ( Tb2[Dates] ) )
)
)
growth =
IF ( Tb2[past] = BLANK (), 0, ( Tb2[Values] - Tb2[past] ) / Tb2[past] )
And then monthly - however some months dont have data - empty. Is there a way to treat those empty months as 0? And then show current month growth as 0? With the last growth figure by its side - with the last growth date?
I cannot understand above requirement well, please illustrate your desired result with more details.
Best regards,
Yuliana Gu
Hi @Anonymous,
Please try to add calculated columns with below DAX:
past =
LOOKUPVALUE (
Tb2[Values],
Tb2[Names], Tb2[Names],
Tb2[Dates], CALCULATE (
MAX ( Tb2[Dates] ),
FILTER ( ALLEXCEPT ( Tb2, Tb2[Names] ), Tb2[Dates] < EARLIER ( Tb2[Dates] ) )
)
)
growth =
IF ( Tb2[past] = BLANK (), 0, ( Tb2[Values] - Tb2[past] ) / Tb2[past] )
And then monthly - however some months dont have data - empty. Is there a way to treat those empty months as 0? And then show current month growth as 0? With the last growth figure by its side - with the last growth date?
I cannot understand above requirement well, please illustrate your desired result with more details.
Best regards,
Yuliana Gu
When trying the dataset which is computed manually @v-yulgu-msft it works like a charm! But the issue still persists with that error in a normal table.
Thank you for your response @v-yulgu-msft, however the callculated collumn shows me this error.
"A table of multiple values was supplied when a single value was expected"
Could the issue be that my NAMES (company) are related from another collumn and my vallues(margin real) are callculated collumn as well?
Regarding the monthly growth what I would like to do is a moving average of monthly/ 3 months/ 6 months.
I think I know how to do it (DAX below). But would like to do it by the Company (NAMES in your pbix). Not that advanced in DAX when it comes towards this.
Moving 3 AVG =
CALCULATE (
AVERAGE ( Orders[Margin Real] );
DATESINPERIOD (
Orders[actual_delivery_date];
LASTDATE ( Orders[actual_delivery_date] );
-3;
MONTH
)
)
Thank you for your help and time @v-yulgu-msft.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 57 | |
| 38 | |
| 32 | |
| 18 | |
| 16 |
| User | Count |
|---|---|
| 66 | |
| 66 | |
| 40 | |
| 34 | |
| 25 |