Forum Discussion
Unable to get accurate result when comparing current data with previous data based on the filter con
Hello Team,
when I compare the live table data with historical table data it is working fine. If I use filter condition then figures are slightly changing and trends are not working . Request you please provide solution for this
I used dax formula like this
Previous week = snapshot table and this week = Opportunity table
Snapshots_Unweigted Orderentry_Budget% =
Opportunities_Unweigted Orderentry_Budget% =
Opportunities : Not accurate
4 Replies
- AllisonKennedy
Community Champion
siva_yellanuri Your DAX looks like a rather complex text manipulation - what is your data source? Can you do some of the RIGHT() and LEFT() functions in Power Query instead of DAX? What does your data model look like? Having your data model set up as a proper star schema will help. Can you share your relationships and raw data and some more info?
Here's some blogs I wrote on star schema that may help too: Excel with Allison: Search results for complicated
- siva_yellanuriNew Member
Hi Allison,
Thanks for your reply. Actually data is coming from the Business application so that is live data i wont get Report view option to go to power query to update the changes instead of DAX. There is no relationships between snapshots, Opportunities tables. By using the Treatas function i make the relationship between these tables. I cann't send the Raw data. Request you please assist me why the figures in the tables are not accurate if i filter the data in the slicer.
- AllisonKennedy
Community Champion
How are you getting on with solving this problem?
We need a bit more detail from you still around how your tables are related, TREATAS function is powerful, but as mentioned, you need to be clear about which filters you're using and ensure they're related to the tables in your report or the measure that uses the TREATAS.
Can you share your treatas measures?
Also, careful with your < and > as you're using these in a text field, so they may not behave how you expect.
I have used Daxformatter.com to format one of your measures, makes it a bit easier to read:
Opportunities_Unweigted Orderentry_Budget% =
IF (
RIGHT (
SELECTEDVALUE ( Opportunities[Fiscal Period] ),
4
) & "-"
& LEFT (
SELECTEDVALUE ( Opportunities[Fiscal Period] ),
2
) < ( [Current_Quater] ),
( [c_ActualsWon_IND] / [c_Budget_IND] ),
IF (
[c_ActualsWon_IND] < [c_Budget_IND],
DIVIDE (
[c_TotalUOE],
( [c_Budget_IND] - [c_ActualsWon_IND] ),
0
),
DIVIDE (
( [c_TotalUOE] + [c_ActualsWon_IND] ),
[c_Budget_IND],
0
)
)
)Anonymous
- AnonymousNot applicable
Hi AllisonKennedy ,
Thanks for the quick response.
Hi siva_yellanuri ,
I have some information to add.
Ensure that your slicers are correctly configured to interact with both your and tables. If your slicers are not properly connected to these tables, it could lead to inaccurate filtering and, consequently, incorrect results.
More details : https://learn.microsoft.com/en-us/power-bi/visuals/power-bi-visualization-slicers.
The behavior you're experiencing could be due to how the filter context is applied when you select a region from the slicer. It's important to understand that slicers change the filter context, and this can affect your DAX calculations. More details : https://learn.microsoft.com/en-us/power-bi/guidance/dax-filter-context.
How to Get Your Question Answered Quickly - Microsoft Fabric Community
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Community Support Team _ RongtieIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.