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 August 31st. Request your voucher.
Hi
I am trying to replicate with DAX what I can do in Excel. Basically, I need a measure that can lookup some values from a Table based on the hard coded value "Xccy" in the Base Column and a dynamic value provided by a Slicer (retrieved in DAX by
Solved! Go to Solution.
Certainly! It seems like you want to create a DAX measure that looks up values from a table based on a hardcoded value "Xccy" in the Base Column and a dynamic value from a slicer for the CCY column, while still considering the visual filter on the Period column.
Assuming you have a table named "YourTable" and the columns are "Base," "CCY," and "Period," and you want to create a measure that looks up values based on "Xccy" in the Base column and the dynamic CCY from the slicer, you can use the following DAX formula:
YourMeasure =
CALCULATE (
SUM ( YourTable[YourValueColumn] ),
YourTable[Base] = "Xccy",
YourTable[CCY] = SELECTEDVALUE ( Selector[CCY] )
)
Replace "YourValueColumn" with the actual column that you want to aggregate or perform calculations on.
This DAX measure uses the CALCULATE function to modify the filter context. It filters the table to include only rows where the Base column is "Xccy" and the CCY column matches the selected value from the slicer. The visual filter on the Period column is still considered.
Make sure to adjust the column names and table names according to your actual data model.
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
In case there is still a problem, please feel free and explain your issue in detail, It will be my pleasure to assist you in any way I can.
Certainly! It seems like you want to create a DAX measure that looks up values from a table based on a hardcoded value "Xccy" in the Base Column and a dynamic value from a slicer for the CCY column, while still considering the visual filter on the Period column.
Assuming you have a table named "YourTable" and the columns are "Base," "CCY," and "Period," and you want to create a measure that looks up values based on "Xccy" in the Base column and the dynamic CCY from the slicer, you can use the following DAX formula:
YourMeasure =
CALCULATE (
SUM ( YourTable[YourValueColumn] ),
YourTable[Base] = "Xccy",
YourTable[CCY] = SELECTEDVALUE ( Selector[CCY] )
)
Replace "YourValueColumn" with the actual column that you want to aggregate or perform calculations on.
This DAX measure uses the CALCULATE function to modify the filter context. It filters the table to include only rows where the Base column is "Xccy" and the CCY column matches the selected value from the slicer. The visual filter on the Period column is still considered.
Make sure to adjust the column names and table names according to your actual data model.
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
In case there is still a problem, please feel free and explain your issue in detail, It will be my pleasure to assist you in any way I can.
User | Count |
---|---|
12 | |
8 | |
6 | |
6 | |
6 |
User | Count |
---|---|
24 | |
14 | |
13 | |
9 | |
7 |