Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi all,
I have a column Cost_Percentage and a measure Base_Percentage. DAX for Base_Percentage is as follows:
Base_Percentage = IF(HASONEVALUE('Table_A'[Percentage_Base_Change]), VALUES('Table_A'[Percentage_Base_Change]), 0)
I am using this Base_Percentage measure in slicer so that user can select the specific percentage.
I want to subtract Cost_Percentage and Base_Percentage (Whatever user selects).
Say if user selects Base_Percentage = 30 from the slicer, then values in the column Cost_Percentage should be subtracted by 30.
But I cannot use Cost_Percentage with Base_Percentage in the measure directly .
Say, Measure_1 = (Cost_Percentage - Base_Percentage), How can I read all single rows values of the column Cost_Percentage and subtract it from the measure Base_Percentage for which the user will select the value from the slicer?
The logic is quite large but for now I just want to know how can I use the column in the measure for some mathematical expression.
Thanks in Advance.
@shubh_kush , You can not create a column with measure. You have to create measure and force context at like level
new measure
sumx(values(Table[ID]) , sum(Table[Cost_Percentage]) -[Base_Percentage])
Assuming ID is at the lowest level.
if not then try like
sumx(values(Table[ID]) , sum(Table[Cost_Percentage]) -[Base_Percentage]*count(Table[ID]))
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
98 | |
97 | |
75 | |
71 | |
64 |
User | Count |
---|---|
143 | |
109 | |
103 | |
82 | |
74 |