Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hi,
I am trying to create a dynamic RFM analysis based on the Year and Month selected from a slicer. The logic is: if Year = 2025 and Month = April are selected, then go back two years from the selected period, retrieve all the transactions within that range, and perform the RFM calculation on that data. I was able to achieve this using a measure, and the following table works as expected.
But now I want to create a dashboard that shows the total number of customers and their sales by each Sub_Category. However, I'm not able to get the correct result and need help.
I have already created a measure that calculates everything perfectly, but for some reason, when I use the measure in a visual, it doesn’t return the correct results.
This is current output which is not correct.
Final Result should be like this.
Solved! Go to Solution.
The only change I made to my previous measure is shown below:
CALCULATETABLE(
'Invoice Header',
REMOVEFILTERS('Calendar'),
REMOVEFILTERS('Invoice Header')
)
I used CALCULATETABLE to remove slicer filters so that the measure controls everything, not the visuals—and it worked.
Thank you.
Thank you for your help. I’ve already fixed the measure, and it’s working now. The issue was with the filter—I fixed it, and everything is working properly.
Great to hear that the issue was with the filter and that it's now resolved and the measure is working as expected.
If you don’t mind, could you please mark your reply as the “Accepted Solution”? Also, if possible, sharing a brief summary of the fix would be really helpful for others who might face a similar issue in the future.
Thanks again for following up, and feel free to reach out if you need any further assistance.
The only change I made to my previous measure is shown below:
CALCULATETABLE(
'Invoice Header',
REMOVEFILTERS('Calendar'),
REMOVEFILTERS('Invoice Header')
)
I used CALCULATETABLE to remove slicer filters so that the measure controls everything, not the visuals—and it worked.
Thank you.
Hi @Abrar786 ,
Thanks for sharing the detailed measure and screenshots.
Your DAX logic for dynamic RFM scoring appears well-structured and should work correctly in isolation. However, since the visual isn’t returning the expected results, a few possible causes could be:
1. Filter Context Mismatch:
The measure builds a variable with Sub_Category, but if your visual uses 'Categories'[Sub_Category], there could be misalignment unless a proper relationship or matching context is established.
2. Missing Mappings in Lookup Tables:
If any RFM score (like 431, 555, etc.) doesn't exist in 'RFM Categories', the LOOKUPVALUE function will return blank. This causes those rows to be excluded from the final count.
3. Coverage Model Filtering:
If your selected Coverage Model from the slicer isn't present across all related tables, it may return zero rows during filtering.
If the issue still persists after trying the above steps, could you please share a sample of your data (no confidential info needed) to assist you better and reproduce this on our side.
This will help us validate the end-to-end logic and provide accurate guidance according to your model.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly and a kudos would be appreciated.
Thank you.
Hi @v-veshwara-msft ,
Here is the .pbix file.
Please note that the current results in the file are not correct. The expected output should match what is shown below.
https://drive.google.com/file/d/1dpKP-JffVUG5DFIF_aUcgV_ioOtSDeQg/view?usp=drive_link
Thank you.
Hi @Abrar786 ,
I’m unable to access the file and have submitted a request. Could you please approve the access?
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.