The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi!
I need to group measures and I decided to do it by creating calculated columns to be able to add them on axis of a barchart. When creating a second column, I get a Circular dependency mistake.
Measure 1:
Solved! Go to Solution.
Hi @Maria9292 ,
You can create the following table for slicer:
Then use the following measure in your measure:
Head_Count =
CALCULATE (
DISTINCTCOUNT ( Staff_data[ID] ),
FILTER (
Staff_data,
(
Staff_data[start_date] <= MAX ( Date[Date] )
&& Staff_data[end_date] >= MAX ( Date[Date] )
)
|| (
Staff_data[start_date] <= MAX ( Date[Date] )
&& ISBLANK ( Staff_data[end_date] )
)
),
FILTER (
Staff_data,
[Age] >= MAX ( Table[MINAGE] )
&& [Age] <= MAX ( Table[MAXAGE] )
)
)
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
@Maria9292 , Are you trying to use a measure in a column. That will not work.
After measure for bucketing, you need to use the independent table
Refer to my video
or
https://www.daxpatterns.com/dynamic-segmentation/
https://radacad.com/grouping-and-binning-step-towards-better-data-visualization
also refer this circular dependency
https://www.sqlbi.com/articles/avoiding-circular-dependency-errors-in-dax/
Thanks @amitchandak!
I watched the video, and it almost what I need, except I need somehow to use this measure instead of ID (in your video it was customer id):
Head_Count =
CALCULATE (
DISTINCTCOUNT(Staff_data[ID]),
FILTER (Staff_data,
(Staff_data[start_date] <= MAX ( Date [Date] )
&& Staff_data[end_date] >= MAX ( Date [Date] )
)
|| (Staff_data[start_date] <= MAX ( Date[Date] )
&& ISBLANK ( Staff_data[end_date])
)))
I need for number of employees to change (thus the measure above), for their age to change (thus the age is also a measure like Date[Date] - DOB) depending on the date chosen and the employees' age to fall into the correct bucket.
Appreciate any help.
Hi @Maria9292 ,
You can create the following table for slicer:
Then use the following measure in your measure:
Head_Count =
CALCULATE (
DISTINCTCOUNT ( Staff_data[ID] ),
FILTER (
Staff_data,
(
Staff_data[start_date] <= MAX ( Date[Date] )
&& Staff_data[end_date] >= MAX ( Date[Date] )
)
|| (
Staff_data[start_date] <= MAX ( Date[Date] )
&& ISBLANK ( Staff_data[end_date] )
)
),
FILTER (
Staff_data,
[Age] >= MAX ( Table[MINAGE] )
&& [Age] <= MAX ( Table[MAXAGE] )
)
)
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
110 | |
80 | |
77 | |
46 | |
39 |
User | Count |
---|---|
141 | |
110 | |
64 | |
64 | |
53 |