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

Get 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

Reply
Cyriaque
Frequent Visitor

Selecting my Segment Calculation Crush my Previous Period Calculation

Good Morning, 
First of all i would like to apologize if one of my sentence or word seem rude and not polite. I'm not a native english speaker.
I'm facing an issue and i hope that,  one of you guy could help me. I will put the fill for you in order to test and get a better understanding of what i want to  solve.

Cyriaque_1-1722267909916.png

As you can see everithing work perfectly for the 2021 year now in the next picture i want to show you the issue i'm facing.

Cyriaque_2-1722268156547.png

You see when i click on one part of my bar chart it's suppose to make normal calcualtion on the previous year and the per capita but the result as you can see is the value of the Segment.
In order for you to get a better understanding of the situation you can see on the powerbi fill all the process i achived to get here.
Please Feel free to give me more explanation in your answer because i'm not a veteran in Powerbi.

This is a link on We transfert in order to see the .Pbix file.
Thanks in Advance.
Ps : https://we.tl/t-mzijBxKMdx

4 REPLIES 4
Cyriaque
Frequent Visitor

Hello Joyce, 
thanks you for your answer.
Yes it's true but it's done on that purpose because it's a group calculation. So if you click on the bar chart as you can see on the second picture of my initial Message you will realise that The selectedYear in matrix change according to the Click of the selected bar chart(wether it's Adopted, Actuals or Current) that's good. But the issue is the Previous year you will notice that it's take straight the Selected year without any calculation as you can see in the follow.

Cyriaque_0-1722388549627.png

 

 

Hi @Cyriaque ,
The YearSelected variable will return the value of the slicer, not the X-axis of the column chart.

YeaSrelected = SELECTEDVALUE(DimYear[FiscalYear])


So when you select the bar chart, it will show the Y-axis value.

 

Hello joyce thank you again because i learned something new,  Especially on the x axis 
So my next question is that  how can i used the both. I Mean be able to use the year slicer with the 

YeaSrelected = SELECTEDVALUE(DimYear[FiscalYear])

and the value on my  Y axis so that when i will clik on my x axis (my slicer ) i will get my correct previousyear that is already done but also when i will click on y axis on the bar chart I will get the correct previousYear values.
thanks in advance my dear.
Cyriaque.
feel free to tell me i you need my original pbix file.

v-yajiewan-msft
Community Support
Community Support

Hi @Cyriaque ,

Based on your pbix file, I think the issue is related to your DynamicMeasure always being “CGPACAMeas”.

 

Selected Year = SWITCH( TRUE(), [DynamicMeasure] = "CGPACAMeas", [CGPACAMeas], [DynamicMeasure])
DynamicMeasure = SELECTEDVALUE(TableActAdpCur[Value], ALL(TableActAdpCur))
TableActAdpCur = { "CGPACAMeas" }

 

So we suggest you add other types and corresponding measure to show the right result.

 

Best regards,

Joyce

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

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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