The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hi Fabric Forum,
Looking for anyone that may have some good ideas on how to best create data models based on calculations and changes in a dimension.
For some detail:
I currently have a Location Dim table, where a column identifies a department as either "Active" or "Inactive". I have measures that calculate a final result based on this "Active" / "Inactive" column. (E.g. amount of sales for all active departments. Note, in this specific case, a department can be inactive and still have sales).
The Goal:
I want to create a model that would determine the "Active" / "Inactive" status based on a specific calculation. For example, if a department is open x days a week (where x is a variable), change it to "Active" / "Inactive"
The Problem:
I am not sure if calculated columns can handle measure calculations (based on my research, they can't). I also know that this may bog down performance because this is a calculated column that will apply to 100s of different departments
Anybody with experience or knowledge willing to shed some light on this?
Proud to be a Super User! | |
Solved! Go to Solution.
Read about how to handle SCD2 (slow changing dimensions)
Hi @ExcelMonke ,
Can you show me you sample dataset?
It's easy to reach your Goal, and here's an example for you:
"Active" / "Inactive" =
VAR _COUNT =
CALCULATE(
DISTINCTCOUNT('Fact Table'[Date]),
ALLEXCEPT('Fact Table', 'Fact Table'[department])
)
RETURN
IF(
_COUNT >= 'Parameter'[Parameter Value],
"Active",
"Inactive"
)
Use this DAX to create a measure or calculated column, and the final output is as below:
But as for the performance aspect, this needs to be judged specifically based on the amount of data you have and the complexity of the data structure.
Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hmm unfortunately that will not meet the needs of what I am trying to accomplish. The parameter value is not something that is user-selected. It is based off of a set of measure calculations
Proud to be a Super User! | |
Read about how to handle SCD2 (slow changing dimensions)
Thank you! This was extremely helpful for me to read up on.
Proud to be a Super User! | |
User | Count |
---|---|
70 | |
67 | |
63 | |
50 | |
28 |
User | Count |
---|---|
113 | |
77 | |
65 | |
55 | |
43 |