Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
DemoFour
Responsive Resident
Responsive Resident

Dynamic colours in a Slicer New not working

Hay peeps,

 

Can any one help with something strange I am experiencing.  

I have built a model and then testing visuals out, added a dynamic colour change to the Slicer (new) visual and it works great, it takes the name of the area and adds a hex code to change the slicer values. colour.  

I have now published the same model to the service, connected to it to build out the visual layer to do the same in the report layer and it won't let me do this.

Any ideas? 

 

Flat file with all loaded data and just adding the visuals for testing

Working in Just a reportWorking in Just a report

 

9c6efac4-dcdc-4979-853d-1eaf3d9f386a.png

What  it doesWhat it does

 

The connection to the semantic model

defdf2a8-201f-4ff0-812a-9ed97849a094.png

I am using a SWITCH() TRUE() and then the name and the corresponding Hex colour I can supply. but I know my DAX is good.

Thanks people

1 ACCEPTED SOLUTION

Hi @DemoFour 

Interpretation:

After testing, if you're not using a measure in the model, you really can't cite it. Based on my understanding, when you connect to a model, it is a real-time connection, and you are connected to a complete model, so you can only refer to the data in this model and the measures that have been created in the model, and cannot modify the model structure or the data in the model, When you format data using measures created in a report, this is equivalent to formatting the data in the model, which is not allowed,This is similar with connecting to SSAS as well, you can refer to the following link.

https://learn.microsoft.com/en-us/power-bi/connect-data/desktop-ssas-multidimensional#considerations...

 

Ways:

If you want to use the measure in the report layer , you need to change the connection mode to direct query, you can select Modify Model in the bottom right corner of the desktop and change it to Direct Query. Then, when the schema modification is complete, you can reference the measure that you created in the report.

vxinruzhumsft_0-1710317014996.png

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

7 REPLIES 7
DemoFour
Responsive Resident
Responsive Resident

Good morning @v-xinruzhu-msft 

Thank you for the clarification, this is also what I discovered from my testing - which is not a problem as all measures can be created in the model.  I will read up on the link you sent, thank you for investigating as well. 

Have a good day

v-xinruzhu-msft
Community Support
Community Support

Hi @DemoFour 

After testing, it can work well in my test, make sure that after connecting the semantic model, in your report, the field name and the table name should be the same as you defined at the measure, or the measure cannot work. 

 

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

HAy @v-xinruzhu-msft 

After some testing in the model pre publishing, then instead of building the measures in the report layer, I built them in the Model and then published to the service and now they work in the report layer connected to the Semantic Model in the service.  

Very strange, do you know if there is a reason that this is happening?  Why would the measure work if it is pushed via the model rather than building the DAX into the visual report? 

Hi @DemoFour 

Interpretation:

After testing, if you're not using a measure in the model, you really can't cite it. Based on my understanding, when you connect to a model, it is a real-time connection, and you are connected to a complete model, so you can only refer to the data in this model and the measures that have been created in the model, and cannot modify the model structure or the data in the model, When you format data using measures created in a report, this is equivalent to formatting the data in the model, which is not allowed,This is similar with connecting to SSAS as well, you can refer to the following link.

https://learn.microsoft.com/en-us/power-bi/connect-data/desktop-ssas-multidimensional#considerations...

 

Ways:

If you want to use the measure in the report layer , you need to change the connection mode to direct query, you can select Modify Model in the bottom right corner of the desktop and change it to Direct Query. Then, when the schema modification is complete, you can reference the measure that you created in the report.

vxinruzhumsft_0-1710317014996.png

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Is this a change of functionality since Fabric has gone into GA? @v-xinruzhu-msft 

This was not the way that it worked before building out a Model and then a seperate Visual report layer as you could add in extra measures. 

This particular model is Excel sheets in a folder, then appended with a functiuon, before the data model is published to the service to connect to as a Thick and Thin report build.

@v-xinruzhu-msft 

Hay, I have updated to the latest version of PBI and no changes! 

Here is the model
ModelModel

 

Here is the table 

Geography Dimension Table.png

 

The Visual = Slicer New

Slicer New.png

 

The Settings 

CF Setting.png

 

The output is still the same

Sematic connection .png

 

The Measure 

Visual LA Colour = 
SWITCH( 
    TRUE(),
        SELECTEDVALUE('Geography table'[Local Authority District] ) = "Birmingham", "#8B2388",
        SELECTEDVALUE('Geography table'[Local Authority District] ) = "Coventry", "#0056BE",
        SELECTEDVALUE('Geography table'[Local Authority District] ) = "Dudley", "#142B50",
        SELECTEDVALUE('Geography table'[Local Authority District] ) = "Sandwell", "#568C20",
        SELECTEDVALUE('Geography table'[Local Authority District] ) = "Solihull", "#215A6D",
        SELECTEDVALUE('Geography table'[Local Authority District] ) = "Walsall", "#4B0242",
        SELECTEDVALUE('Geography table'[Local Authority District] ) = "Wolverhampton", "#422E5D",
        "#fe811b" 
)

 

I can supply the data and a Pbix, as this is all open source data

Thank you for testing, I have tested this in my tenant and in my dev tenant and get the same result when connected to the Semantic Model. 


It works in the flat file before I publish the data model to the service, so this is quite strange! 

Morning @v-xinruzhu-msft thank you for testing, I thought that this may be one of those PBI having a moment type things! 

I will post up pictures, but this is for a presentation I have given so I know that the Field names and the DAX is all good, as I had to post up how to do this in the slide deck. 

I have just had the latest monthly update pushed to me, so I will upgrade to the latest version and test and post pictures if the issue still persists. 



Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.