Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
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.
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
87 | |
84 | |
82 | |
67 | |
49 |
User | Count |
---|---|
135 | |
111 | |
100 | |
65 | |
62 |