Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

Anonymous
Not applicable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

DAX to increment a variable if variation is >= 50%
11-14-2023
08:35 PM
Hi,
I want to count the number of enteries when the varaition between two months was equal or greater than 50 percent.
The DAX is been created as follows:
DSC Road Transport - Diesel YTD =
var nowe = CALCULATE(
SUM('FAV_OE_LOGICS_BUSINESS_METRICS_DATA (2)'[DSC Road Transport - Diesel]),
ALLSELECTED('Calendar'[Date].[Date]))
var prev = CALCULATE(
SUM('FAV_OE_LOGICS_BUSINESS_METRICS_DATA (2)'[DSC Road Transport - Diesel]),
PREVIOUSMONTH('Calendar'[Date].[Date])
)
var variation= DIVIDE((nowe - prev),prev)
return IF(variation>= 0.50,1,0)
In the return statement, I have just conditioned it to mark 0 or 1 but I need a variable to increment everytime when the variance is greater than or equal to 50% and at last it should return me percent of values which is obeying this variation condition.
Thanks and Regards
Rajkaran Singh
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-16-2023
06:42 PM

Hi, @Anonymous
Can you provide sample data for testing? Sensitive information can be removed in advance. What kind of expected results do you expect? You can also show it with pictures or Excel. I look forward to your response.
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources
Recommendations
Subject | Author | Posted | |
---|---|---|---|
07-08-2024 05:08 PM | |||
10-23-2024 03:41 AM | |||
01-08-2025 07:53 PM | |||
11-29-2024 03:07 AM | |||
Anonymous
| 05-15-2021 07:21 AM |
Featured Topics
Top Kudoed Authors (Last Month)
User | Count |
---|---|
117 | |
96 | |
83 | |
55 | |
46 |