Forum Discussion
AlexaderMilland
1 year agoHelper III
Field Parameters and Calculation Groups together?
Im working in power bi. I have a fact.orders table with OrderID | ShipmentDate | PaymentDate | IsNewPayment | IsNewShipment I also have a calendar table with inactive relationships to ShipmentDa...
Anonymous
1 year agoNot applicable
Hi, AlexaderMilland
I'm sorry I can't open your sample file link, I created the sample data:
Orders Table
Calendar Table
Relationship
Create calculated group:
Then put this group in Slicer view and create a new measure, try the following DAX:
IsNewDynamic =
SWITCH(
SELECTEDVALUE('Calculation group'[Calculation group column]),
"ShipmentDate", CALCULATE(SUM('Orders'[IsNewShipment]), USERELATIONSHIP('Calendar'[Date], 'Orders'[ShipmentDate])),
"PaymentDate", CALCULATE(SUM('Orders'[IsNewPayment]), USERELATIONSHIP('Calendar'[Date], 'Orders'[PaymentDate]))
)
Put this measure in visual. When you click on the slicer, the date is switched, here is my preview:
How to Get Your Question Answered Quickly
Best Regards
Yongkang Hua
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- VijayP1 year agoCommunity Champion
Anonymous This is what Exactly i was trying to suggest! Welldone!
- AlexaderMilland1 year agoHelper III
The above solution does not work?