Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
DickyMoo
Frequent Visitor

DAX - Monthly category change

Hi All,

 

I have monthly membership data, each member is in a Category that groups up to a Headline then to an Area. In the fact table I have current month Category and prior month Category.

 

I want to calculate the number of members who move between Headlines each month. Currently I do this by adding calculated columns to the fact table with 'Headline Prior', 'Headline Current', 'Headline Change'.

 

The measure for count of members who moved IN to a Headline is:

Count Moved IN to Headline Category = 
CALCULATE (
    [Member Count],
    MEMBERSHIP[Headline Category Change Status] = "Change"
)
And moved OUT:
Count Moved OUT of Headline Category =
- CALCULATE (
    [Member Count],
    USERELATIONSHIP ( Dim_MemberCategory[Fee Category], MEMBERSHIP[Fee Category - Prior] ),
    MEMBERSHIP[Headline Category Change Status] = "Change"
)
My question is, is there a better way to do this? I feel like using columns in the fact table is a lazy way out of a correct solution. Also, this method hardcodes the level (Headline or Area), and I would like the measure to give me the count of members who moved IN/OUT of the current level shown in a visual, be it Headline or Area.
 
Apologies if this is too rambly or complicated, but any guidance would be appreciated.
 
Thanks
Rich
1 REPLY 1
v-lili6-msft
Community Support
Community Support

hi, @DickyMoo 

Sample data and expected output would help tremendously.
Please see this post regarding How to Get Your Question Answered Quickly:
https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 

Best Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.