Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi all
I have the follwoing model :
I want to be able to clalcute Gender distribution depend on Year and month ..
As you see Dim Employees and Dim Calendar have no direct connection between each other , so I think this should be done through the fact table Fact Departments.
The relation is (one to many) ..
Thanks in advance
Regards
Solved! Go to Solution.
Hi, @Anonymous
just adjust table and column name
try below code
result =
calculate(
sum('dim employees'[gender]),
'dim employees'[gender]="male",
crossfilter('fact departments'[employee_bk],dim employees'[employee_bk],both)
)
If you wish to put your skill to the next level, read artiles on "Expanded Table in Power BI", such as this one:
Expanded tables in DAX - SQLBI
Keep your 1:* relationshipes in the star schema as it is and apply expanded table knowledge to the calculation to implement filtering from many end to 1 end (fact table filters dim table).
Expertise = List.Accumulate( {Days as from Today}, {Skills and Knowledge}, (Current, Everyday) => Current & Day.LeanAndPractise(Everyday) ) |
Hi, @Anonymous
you can change filter direction to both side manually in model view without changing relationship b/w fact table and dimension table
Thank you
I cant change the relationship direction , this is a very big model and changing relaionship direction will cause many issues 🙂
Hi, @Anonymous
make *-*(many to many) relationship bw fact department and dim employee
or
other wise in your dax code use crossfilters function to change direction of filter
Thank you
I cant change the relationship direction , this is a very big model and changing relaionship direction will cause many issues ..
Could you help me writing the DAX scripte to get the total number of 'male' when using crossfilters function ?
Thanks in adavnce
Regards
Hi, @Anonymous
just adjust table and column name
try below code
result =
calculate(
sum('dim employees'[gender]),
'dim employees'[gender]="male",
crossfilter('fact departments'[employee_bk],dim employees'[employee_bk],both)
)
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
144 | |
80 | |
65 | |
52 | |
49 |
User | Count |
---|---|
212 | |
89 | |
80 | |
69 | |
60 |