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.
Hello
i have this situation
i need to compare 2 values for every 2 distinct selected month from the 2 slicers in the right
Now i use the 1 and 2 name, is there a chance to use not 1 or 2 , but the year and month of the selected value in the name in the pivot
which will dinamicaly change based of the selection?
Basically i want to change Units int1 in Units 2024.01 or Units 2023January, and the name will change when i change the selection in slicer 1
Thank you
Solved! Go to Solution.
Hi @cristianj ,
As far as I know, Power BI doesn't support dynamic measure header or column header in matrix visual.
I think we can try to achieve your goal by transform your data model.
My Sample:
Data model:
Measure:
Measure =
VAR _INT1 = SELECTEDVALUE('INT 1'[YearMonth])
VAR _INT2 = SELECTEDVALUE('INT 2'[YearMonth])
VAR _STEP1 = SWITCH(MAX('INT'[Value]) , "INT 1", IF(MAX('DimDate'[YearMonth]) = _INT1,CALCULATE(SUM('Table'[Column1]))), "INT 2", IF(MAX('DimDate'[YearMonth]) = _INT2,CALCULATE(SUM('Table'[Column1]))))
VAR _STEP2 = CALCULATE(SUM('Table'[Column1]),FILTER(ALLSELECTED(DimDate),DimDate[YearMonth] = _INT1))/ CALCULATE(SUM('Table'[Column1]),FILTER(ALLSELECTED(DimDate),DimDate[YearMonth] = _INT2))
VAR _STEP3 = IF(HASONEVALUE(DimDate[YearMonth]),_STEP1,_STEP2)
RETURN
_STEP3
IF(HASONEVALUE(DimDate[YearMonth]),"","0.00%;-0.00%;0.00%")
Result is as below
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @cristianj ,
As far as I know, Power BI doesn't support dynamic measure header or column header in matrix visual.
I think we can try to achieve your goal by transform your data model.
My Sample:
Data model:
Measure:
Measure =
VAR _INT1 = SELECTEDVALUE('INT 1'[YearMonth])
VAR _INT2 = SELECTEDVALUE('INT 2'[YearMonth])
VAR _STEP1 = SWITCH(MAX('INT'[Value]) , "INT 1", IF(MAX('DimDate'[YearMonth]) = _INT1,CALCULATE(SUM('Table'[Column1]))), "INT 2", IF(MAX('DimDate'[YearMonth]) = _INT2,CALCULATE(SUM('Table'[Column1]))))
VAR _STEP2 = CALCULATE(SUM('Table'[Column1]),FILTER(ALLSELECTED(DimDate),DimDate[YearMonth] = _INT1))/ CALCULATE(SUM('Table'[Column1]),FILTER(ALLSELECTED(DimDate),DimDate[YearMonth] = _INT2))
VAR _STEP3 = IF(HASONEVALUE(DimDate[YearMonth]),_STEP1,_STEP2)
RETURN
_STEP3
IF(HASONEVALUE(DimDate[YearMonth]),"","0.00%;-0.00%;0.00%")
Result is as below
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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 | |
95 | |
83 | |
70 | |
66 |
User | Count |
---|---|
118 | |
106 | |
93 | |
79 | |
72 |