I have the following data model in a SSAS Cube:
data model sales cube
FACT_Sales example
I have set the following mdx formulas for the dynamic security role