Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi All,
Need help. I have one table for Sales and two seperate columns for date, one each for Daily and week (Week Start Dt Monday)
My Data looks something like this
Product | Trans Date | Week Date | Sales |
A | 4/27/21 | 4/26/21 | 10 |
A | 4/30/21 | 4/26/21 | 50 |
What I am trying to achive is to provide a slicer as Daily / Weekly and the the table should show the Date column and other details based on selection.
For example : if user selects Daily then the table visual should show Product, Date (Trans Date) and Sales (total for date)
and if user select Weekly then table visual should show Product, Date (week Date) and Sales (total for week)
Thanks
Solved! Go to Solution.
Got it I was missing that part due to which were not able to get the expected result.
I will give it a try.
Thank you
Hi, @PradeepDive
Please check the below picture and the sample pbix file's link down below.
All measures are in the sample pbix file.
Sales Total by slicer =
SWITCH (
SELECTEDVALUE ( Slicer[Slicer], "Daily" ),
"Daily",
CALCULATE (
[Sales Total],
TREATAS ( VALUES ( Slicer[Link] ), 'Calendar'[Date] )
),
"Weekly",
CALCULATE (
[Sales Total],
TREATAS ( VALUES ( Slicer[Link] ), 'Calendar'[Start of Week] )
),
CALCULATE (
[Sales Total],
TREATAS ( VALUES ( Slicer[Link] ), 'Calendar'[Date] )
)
)
https://www.dropbox.com/s/3yw7h92dwz5dyel/pradeepdive.pbix?dl=0
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.
Linkedin: linkedin.com/in/jihwankim1975/
Twitter: twitter.com/Jihwan_JHKIM
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Thank you for you reply,
I checked the formula above but it is giving me total of sales. What I am trying to get is based on slicer selection (daily / weekly) the date column (Link in your case) should change.
Am I missing anything in your solution ?
Hi, @PradeepDive
Thank you for your feedback.
Because the slicer is selecting Weekly, it is showing the weekly total.
If you select Daily, then each date will show in the visualization.
Can you describe what do you want to see when you select Weekly in the slicer? Do you want to see all dates separately in that specific week?
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
That's how I wanted,
Due to org security I can not download the pbix you attached. Can you please share what is there under Slicer[Link]
Hi, @PradeepDive
I am not sure how to describe in words what is under Slicer[Link].
It is the union column of Calendar[Date] and Calendar[Start of Week].
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Got it I was missing that part due to which were not able to get the expected result.
I will give it a try.
Thank you
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
96 | |
93 | |
82 | |
70 | |
64 |
User | Count |
---|---|
118 | |
106 | |
93 | |
79 | |
72 |