The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
I have a below function
Hi @Mojtaba ,
Try adding "+0" after [Actual Usage].
Potential Saving calculation = ([Expected Usage]-([Actual Usage]+0))*AVERAGE(Forecast_Table[Price])
Best Regards,
Jay
I tried but no changes happened
I just copy pasted your code please see below screen shot
still takes in account expected usage when there is no actual usage
instead of showing only 95k it shows 981K
Hi @Mojtaba
I am really sorry but without more detailed information and the model, I won't be able to assist. If you are able to share, I am sure that a resolution can be created. It is just a bit difficult making assumptions, etc., on the data types, relationships, filters, etc., that are not transparent through the screenshots, etc.
I trust you understand.
Theo
If I have posted a response that resolves your question, please accept it as a solution to formally close the post.
Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!
Want to connect?www.linkedin.com/in/theoconias
Could it be because this is how I calculated actual usage?
@Mojtaba I'm unsure what your Actual Usage measure in the current state is aiming to achieve but if you are just wanting to SUM the value of your [Actual_Usage] column, I would highly recommend just using SUM. For example:
TotalActualUsage = SUM ( 'Actual_Table'[Actual Usage]).
If I have posted a response that resolves your question, please accept it as a solution to formally close the post.
Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!
Want to connect?www.linkedin.com/in/theoconias
I did this to sum only unique value for each month.For some reason ,not sure why.I had repetitive number in a month
@Mojtaba The reason that this may have occurred is because of the format that your date columns (i.e. Month Year) are currently structured. It is likely they were sitting as "text" and not connected reflective of a "date". I believe it would be of material benefor for you to add a Data table that acts as the "source of truth" when you're using dates to slice and filter your data. I highly recommend you add a Date table and use that as the basis of filtering, axis, etc for your report. You can get this from here: https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/).
If I have posted a response that resolves your question, please accept it as a solution to formally close the post.
Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!
Want to connect?www.linkedin.com/in/theoconias
what info you need?
snap shots of table relationships?
and field parts?
@Mojtaba yes please. An example of data used, a snapshot of your relationships, etc. Thank you.
If I have posted a response that resolves your question, please accept it as a solution to formally close the post.
Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!
Want to connect?www.linkedin.com/in/theoconias
relaationship
table 1
table 2
fields
Hi @Mojtaba
For the first measure, you could try something such as the following:
Potential Saving Calculation =
VAR _PotentialSaving = ( [Expected Usage] - [Actual Usage] ) * AVERAGE ( Forecast_Table [Price] )
RETURN
IF ( ISBLANK ( [Actual Usage] ) , "" , _PotentialSaving )
For the second measure, try the same approach:
Forecast Accuracy =
VAR _ForecastAccuracy = ABS ( ABS ( ( SUM ( Actual_Table [Expected_Usage] ) - [Actual Usage] ) ) / [Actual Usage] * 100 -100 )
RETURN
IF ( ISBLANK ( [Actual Usage] ) , "" , _ForecastAccuracy)
Hope this helps!
If I have posted a response that resolves your question, please accept it as a solution to formally close the post.
Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!
Want to connect?www.linkedin.com/in/theoconias
User | Count |
---|---|
68 | |
63 | |
59 | |
54 | |
28 |
User | Count |
---|---|
182 | |
81 | |
63 | |
47 | |
41 |