cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
DM_EU
Helper I
Helper I

Compare more than 2 periods

Hello, 

 

My client would like to compare the data on different periods like in the screenshot below but it does not work for me (I should see data on period 4). 

DM_EU_0-1691045734860.png

 

Here are my measures :

 

Spots period 1 = CALCULATE(
    SUM(BI_PRE_TELECAST_VIEW[ElementDuration]),
    USERELATIONSHIP('Period 1'[Date], BI_PRE_TELECAST_VIEW[BroadcastingDate]), REMOVEFILTERS('Dim Date'),REMOVEFILTERS('Period 2'), REMOVEFILTERS('Period 3'), REMOVEFILTERS('Period 4'))
 
Spots period 2 = CALCULATE(
    SUM(BI_PRE_TELECAST_VIEW[ElementDuration]),
    USERELATIONSHIP('Period 2'[Date], BI_PRE_TELECAST_VIEW[BroadcastingDate]), REMOVEFILTERS('Dim Date'),REMOVEFILTERS('Period 1'), REMOVEFILTERS('Period 3'), REMOVEFILTERS('Period 4'))
 
Spots period 3 = CALCULATE(
    SUM(BI_PRE_TELECAST_VIEW[ElementDuration]),
    USERELATIONSHIP('Period 3'[Date], BI_PRE_TELECAST_VIEW[BroadcastingDate]),  REMOVEFILTERS('Dim Date'),REMOVEFILTERS('Period 1'), REMOVEFILTERS('Period 2'), REMOVEFILTERS('Period 4'))
 
Spots period 4 = CALCULATE(
    SUM(BI_PRE_TELECAST_VIEW[ElementDuration]),
    USERELATIONSHIP('Period 4'[Date], BI_PRE_TELECAST_VIEW[BroadcastingDate]), REMOVEFILTERS('Period 1'), REMOVEFILTERS('Period 2'), REMOVEFILTERS('Period 3'))


And my parameter that I put on Y axe : 

 

Parameter Periods = {
    ("Period 1", NAMEOF('Measure table'[Spots period 1]), 0),
    ("Period 2", NAMEOF('Measure table'[Spots period 2]), 1),
    ("Period 3", NAMEOF('Measure table'[Spots period 3]), 2),
    ("Period 4", NAMEOF('Measure table'[Spots period 4]), 3)
}
 
And here are the filters applied when I hoover the filter icon: 
DM_EU_0-1691046072810.png

 

And here is the data model behind (only the dates tables layout) :

DM_EU_0-1691046293463.png

 

 

Is this scenario at least possible in Power BI ? If yes, where I am getting wrong ?

 

Thank you!

Best regards

1 REPLY 1
MFelix
Super User
Super User

Hi @DM_EU ,

 

Looking at the model since the tables have inactive relationships there is no need for you to remove the filters from the other tables, since the calculation will go trough the active relationship.

 

But without any data is difficult to pinpoint the issue.

 

Can you please share a mockup data or sample of your PBIX file. You can use a onedrive, google drive, we transfer or similar link to upload your files.

If the information is sensitive please share it trough private message.

 

If you can also give an expected result would be great.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

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

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors